From c84f73575c4f3aaba2c6cd459f96b91d3ab4b622 Mon Sep 17 00:00:00 2001 From: arbazsiddiqui Date: Sun, 22 May 2016 21:56:37 +0530 Subject: [PATCH] implemented all the getters for houses --- asoiaf.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/asoiaf.js b/asoiaf.js index 0e99432..f682139 100644 --- a/asoiaf.js +++ b/asoiaf.js @@ -50,16 +50,42 @@ var asoiaf = function() { return httpGet(url); } - exports.getCharacterByCulture = function(culture_name) { + exports.getCharactersByCulture = function(culture_name) { var url = 'http://www.anapioficeandfire.com/api/characters/?culture=' + culture_name; return httpGet(url); } - exports.getCharacterByGender = function(gender) { + exports.getCharactersByGender = function(gender) { var url = 'http://www.anapioficeandfire.com/api/characters/?gender=' + gender; return httpGet(url); } - + //Getters for House + + exports.getAllHouses = function() { + var url = 'http://www.anapioficeandfire.com/api/houses'; + return httpGet(url); + } + + exports.getHouseByID = function(house_id) { + house_id = house_id.toString(); + var url = 'http://www.anapioficeandfire.com/api/houses/' + house_id; + return httpGet(url); + } + + exports.getHouseByName = function(house_name) { + var url = 'http://www.anapioficeandfire.com/api/houses/?name=' + house_name; + return httpGet(url); + } + + exports.getHouseByRegion = function(region) { + var url = 'http://www.anapioficeandfire.com/api/houses/?region=' + region; + return httpGet(url); + } + + exports.getHouseByWords = function(words) { + var url = 'http://www.anapioficeandfire.com/api/houses/?words=' + words; + return httpGet(url); + } }();