-
-
Save micmath/1025743 to your computer and use it in GitHub Desktop.
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
/** | |
* A module for retrieving information about Photos from Foursquare. | |
* @module "node-foursquare.Photos" | |
*/ | |
/** | |
* Create a new Photos object. | |
* @constructor | |
* @param {Object} config A valid configuration. | |
*/ | |
exports.Photos = function(config) { | |
var core = require("./core")(config), | |
logger = require('log4js')(config.log4js).getLogger("node-foursquare.Photos"); | |
/** | |
* Retrieve a photo from Foursquare. | |
* @memberof module:"node-foursquare.Photos".Photos# | |
* @param {String} photoId The id of the Photo to retreive. | |
* @param {String} accessToken The access token provided by Foursquare for the current user. | |
* @param {Function} callback The function to call with results, function({Error} error, {Object} results). | |
* @see https://developer.foursquare.com/docs/photos/photos.html | |
*/ | |
function getPhoto(photoId, accessToken, callback) { | |
logger.debug("ENTERING: Photos.getPhoto"); | |
if(!photoId) { | |
logger.error("getPhoto: photoId is required."); | |
callback(new Error("Photos.getPhoto: photoId is required.")); | |
return; | |
} | |
core.callApi("/photos/" + photoId, accessToken, "photo", null, callback); | |
} | |
return { | |
"getPhoto" : getPhoto | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment