Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A node.js wrapper for the Foursquare API
CoffeeScript
tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
src
.gitignore
Cakefile
package.json
readme.md

readme.md

4sq

A Node.JS wrapper for the Foursquare API.

How to use with JavaScript

var foursquare = require('4sq');

var fsq = new foursquare({token: 'OAuth2 access_token'});

fsq.checkins('self', {limit: 5}, function(error, data) {
  if (error) {
    throw new Error(error);
  }

  console.log(data);
});

Or with CoffeeScript

foursquare = require '4sq'

fsq = new foursquare token: 'OAuth2 access_token'

fsq.checkins 'self', limit: 5, (error, data) ->
  throw new Error error if error
  console.log data

Install with NPM

npm install 4sq

How to retrieve Foursquare OAuth2 access_token

Grab latest source code and install all dev dependencies

npm link

Change your host, client id, client secret in examples/get-access-token.coffee and after that run examples/get-access-token.coffee

coffee examples/get-access-token.coffee

API

  • user (user id, params, callback)
  • checkins (user id, params, callback)
  • badges (user id, params, callback)

Author

Something went wrong with that request. Please try again.