clintandrewhall/node-foursquare

Add a getDetails function for Venues

Closed this issue · 1 comments

I don't know how to do a pull request, but I needed access to the data returned by this endpoint: https://developer.foursquare.com/docs/api/venues/details

In venues.js I added

var getDetails = function getDetails(venueId) {
    var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var accessToken = arguments[2];
    var callback = arguments[3];

    var method = 'getDetails';
    logger.enter(method);
    return getSimpleEndpoint(venueId, method, '', params, accessToken, callback);
  };

and changed the return to include the new function:

return {
    browseBox,
    browseCircle,
    exploreLocation,
    exploreNear,
    getBoxedSuggestCompletion,
    getCategories,
    getDetails,
    getEvents,
    getHours,
    getLikes,
    getLinks,
    getListed,
    getLocationSuggestCompletion,
    getLocationTrending,
    getManagedVenues,
    getMenu,
    getNearSuggestCompletion,
    getNearTrending,
    getNextVenues,
    getPhotos,
    getSimilar,
    getStats,
    getTimeSeriesStats,
    getTips,
    globalSearch,
    like,
    match,
    searchLocation,
    searchNear,
    unlike
  };

Added, tested and published as v0.4.6.

Thanks for letting me know! Cheers!