Git Product home page Git Product logo

node-foursquare's People

Contributors

adamjaffe2 avatar andrewlyross avatar batdevis avatar brutaldev avatar clintandrewhall avatar fennb avatar gamebox avatar jonmarkgo avatar kmiyashiro avatar lkosak avatar mathisonian avatar matiassingers avatar matteoagosti avatar mhemesath avatar randometc avatar tuler avatar viktorkelemen avatar yasharf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-foursquare's Issues

Changes to Foursquare API

Source: https://developer.foursquare.com/docs/announcements

Beginning on May 31st, Foursquare is making five changes in order to simplify their API and maintain the quality of their service as their developer community grows. These changes are:

  1. The quantity of photos and tips per venue will be changed to 1 for Sandbox Tier and 2 Personal Tier
  2. Access to check-in counts, visit counts, chain details, and key tastes will be removed
  3. Venues search, explore, trending, similar, and next endpoints will return the following fields: venue name, venue ID, address, lat/long, and category. To access additional rich content for each venue, please call the details (venues/x) endpoint with venue ID as a parameter.
  4. Regular endpoints will have a quota of 950 calls per day for Sandbox Tier and 99,500 calls per day for Personal Tier. Premium endpoints will have a quota of 50 calls per day for Sandbox Tier and 500 calls per day for Personal Tier. More info on our endpoints can be found here.
  5. The caching time frame has been reduced to 24 hours. See here for more details.

======================

I suspect 2 might require some modification to this npm module.

Changed venues/search API version

Just a couple of non-critical issues I have noticed while using the venues/search API

The Foursquare Venues API now deprecates versions <= 20110608 (see https://developer.foursquare.com/docs/venues/search.html) and the returned result has now a meta that looks like:
{"meta":{"code":200,"errorType":"deprecated","errorDetail":"This endpoint...

i) I think it would be nice (and easy) to log (WARN | ERROR) these messages in core.js -> extractData like:
if(json.meta.errorType) {
logger.error("Error type: "" + json.meta.errorType + "" - " + json.meta.errorDetail);
}

ii) 4SQ API seem to become more dependent on the version number (the docs even says that in the near future APIs with no version will default to the latest version - instead of the oldest). The version should probably be added to config-default.js so that clients can set their preferred version

iii) Enforcing a version > 20110608 in venues/search (e.g. 20110609) via param {v : 20110609} now returns an array of "venues" and not "groups". This means extractData() in core.js will report an error since the field "groups" does not exist. I have temporarily hacked search() in venues.js to set the "fields" param to "venues" (instead of "groups") if the API version is higher than 20110608.

'TypeError: require(...) is not a function' error with 0.4.* version

when using 0.4.* version in a CommonJS setup the error 'TypeError: require(...) is not a function' appears:
sahat/hackathon-starter#888
The project is written using CommonJS setup:

$ npm start

> [email protected] start /mnt/c/temp/hackathon-starter
> node app.js

/mnt/c/temp/hackathon-starter/controllers/api.js:16
const { Venues, Users } = require('node-foursquare')({
                                                    ^

TypeError: require(...) is not a function
    at Object.<anonymous> (/mnt/c/temp/hackathon-starter/controllers/api.js:16:53)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/mnt/c/temp/hackathon-starter/app.js:35:23)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)

Can the Babel setup be configured to support default module exports for ES5/CommonJS:
https://babeljs.io/docs/en/babel-plugin-transform-es2015-modules-commonjs.html
Otherwise it breaks backward compatibility

Thanks!

Readme typo

On your README example it's written:

  var foursquare = require("node-foursquare")(config);

Shouldn't it be this?

var foursquare = require("node-foursquare-2")(config);

getUser without parameters

Function getUser haven't any parameters so I can't get self user because I can't add parameter 'v' for supported API version, I have got this error:
[Error: 410: The Foursquare API no longer supports requests that do not pass in a version parameter. For more details see https://developer.foursquare.com/overview/versioning]

Add a getDetails function for Venues

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
  };

Need assistance on usage

Hello, is this still being maintained?

I want to know how to properly utilized this library.

// My Manager
export default class FoursquareManager {
  constructor() {
    const config = {
      secrets: {
        clientId: 'xxxxx',
        clientSecret: 'xxxx$',
        redirectUrl: 'xxxx,
      },

    };
    this.foursquare = require("node-foursquare")(config);
  }

  getVenues() {
    console.log('getting venues');
    // Set the accesstoken as an empty string since I'm only accessing the public api.
    return this.foursquare.Venues.search('40.7', '-74', null, {}, '', function (error, data) {
      return data;
    })
  }
}

Testing via mocha:

describe("FoursquareManager", () => {

  let fsqManager;

  beforeEach(() => {
    fsqManager = new FoursquareManager();
  });

  context("getVenues", () => {
    context("can get venues", () => {
      it("gets venues", done => {
        let data = fsqManager.getVenues();
        console.log('test', data);
        done();
      });
    });
  });
});

Logging the data it revealed that is undefined.

Is this the expected behavior then using this library or I'm using this in the wrong way?

Node can't access #access_token=X on foursquare redirect

When foursquare redirects authenticated users, it appends the token via a fragment. Ideally, I'd like to do some processing on the server when that redirect hits. It appears, however, that NodeJS ignores the #access_token=XXXX completely, and does not make that information available on the request. I can fix this using the client as a proxy and make yet another request, which feels hacky and adds latency.

Just wondering if anyone has encountered this issue, and how it could be address using node-foursquare.

NSP/Snyke.io report of volunerability - upgrade of winston dependency

Snyk.io is reporting that node-foursquare depends on an out-of-date version of winston which is using a vulnerable version of request. Winston as of version 0.8.0 no longer has a dependency on request. Can you please upgrade node-foursquare to use a more updated version of winston?

is log4js strictly necessary?

It's quite an invasive library to import by default - we're wondering if there's a way to suppress it, either directly or via node-foursquare?

Validation for ll/near is incorrect in venues if NW/SW bound are provided

The application makes ll or near required, but the api would also work if only NE/SW is required. The condition in venues.search should be something like that:
function search(lat, lng, near, params, accessToken, callback) {
logger.enter('search');
params = params || {};

if(!lat || !lng) {
if(!near) {
if (!params.ne || !params.sw) {
logger.error('Either lat and lng, near, or ne/sw are required as parameters.');
callback(new Error('Venues.explore: near or ne/sw must be specified if lat and lng are not set.'));
return;
}
} else {
params.near = near;
}
} else {
params.ll = lat + ',' + lng;
}

logger.debug('search:lat: ' + lat);
logger.debug('search:lng: ' + lng);
logger.debug('search:near: ' + near);
logger.debug('search:params: ' + util.inspect(params));
core.callApi('/venues/search', accessToken, params, callback);

}

Cannot find module 'foursquarevenues'

Afters run npm install foursquarevenues in the same directory of my app, i receive this error Cannot find module 'foursquarevenues' i need to installed globally for that work, I realized that in github the package.json
{
....
"main": "./foursquareVenues"
....
}
the 'V' uppercase but in npm is lowercase after update this everything work fine.

please update this in npm. Because in my production server (nodjitsu) i cannot install it globally

sory for my english

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.