Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added more error checking

  • Loading branch information...
commit aa9cd18579a2850fe60533a809b0a35560351eeb 1 parent 8417b88
@TJkrusinski TJkrusinski authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 foursquare.js
View
25 foursquare.js
@@ -79,88 +79,113 @@ module.exports = function(appId, secretKey){
return {
venues: {
venue: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId), callback);
},
categories: function(callback){
+ if(!callback) return;
fourSquare.get(fourSquare.query('/venues/categories'), callback);
},
search: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/search', infoObj), callback);
},
explore: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/explore', infoObj), callback);
},
suggestcompletion: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/suggestcompletion', infoObj), callback);
},
trending: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/trending', infoObj), callback);
},
events: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/events'), callback);
},
hours: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/hours'), callback);
},
likes: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/likes'), callback);
},
links: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/links'), callback);
},
listed: function(venueId, infoObj, callback){
+ if(!venueId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/listed', infoObj), callback);
},
menu: function(venueId, callback){
+ if(!venueId || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/menu'), callback);
},
photos: function(venueId, infoObj, callback){
+ if(!venueId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/photos', infoObj), callback);
},
tips: function(venueId, infoObj, callback){
+ if(!venueId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/venues/'+venueId+'/tips', infoObj), callback);
},
},
tips: {
search: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/tips/search', infoObj), callback);
},
done: function(tipId, infoObj, callback){
+ if(!tipId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/tips/'+tipId+'/done', infoObj), callback);
},
likes: function(tipId, callback){
+ if(!tipId || !callback) return;
fourSquare.get(fourSquare.query('/tips/'+tipId+'/likes'), callback);
},
listed: function(tipId, infoObj, callback){
+ if(!tipId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/tips/'+tipId+'/listed', infoObj), callback);
},
},
lists: {
detail: function(listId, infoObj, callback){
+ if(!listId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/lists/'+listId, infoObj), callback);
},
followers: function(listId, callback){
+ if(!listId || !callback) return;
fourSquare.get(fourSquare.query('/lists/'+listId+'/followers'), callback);
},
},
specials: {
detail: function(listId, infoObj, callback){
+ if(!listId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/specials/'+listId, infoObj), callback);
},
search: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/specials/search', infoObj), callback);
},
},
events: {
categories: function(callback){
+ if(!callback) return;
fourSquare.get(fourSquare.query('/events/categories'), callback);
},
search: function(infoObj, callback){
+ if(!infoObj || !callback) return;
fourSquare.get(fourSquare.query('/events/search', infoObj), callback);
},
},
pages: {
venues: function(pageId, infoObj, callback){
+ if(!pageId || !infoObj || !callback) return;
fourSquare.get(fourSquare.query('/pages/'+pageId+'/venues', infoObj), callback);
},
},
Please sign in to comment.
Something went wrong with that request. Please try again.