Created
July 13, 2013 20:52
-
-
Save tomasdev/5992173 to your computer and use it in GitHub Desktop.
Get all Foursquare categories with jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parse = function (categories) { | |
categories.forEach(function (category) { | |
if (category.categories && category.categories.length) { | |
console.group(category.name); | |
parse(category.categories); | |
console.groupEnd(category.name); | |
} else { | |
console.log(category.name); | |
} | |
}); | |
}; | |
$.getJSON('https://api.foursquare.com/v2/venues/categories?oauth_token=GXAGYHX5KE3JEPUGVPNDWTBZJ4DCUCYBCSTVZGSYIDUED1TU&v=20130713&callback=?', function (data) { | |
parse(data.response.categories); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment