Skip to content

Instantly share code, notes, and snippets.

@tomasdev
Created July 13, 2013 20:52
Show Gist options
  • Save tomasdev/5992173 to your computer and use it in GitHub Desktop.
Save tomasdev/5992173 to your computer and use it in GitHub Desktop.
Get all Foursquare categories with jQuery
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