4sq 中文文档教程
4sq
Foursquare API 的 node.js 包装器。
Installation
$ npm install 4sq
Examples
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);
});
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
How to retrieve foursquare OAuth2 access_token
获取最新的源代码并安装所有开发依赖
$ npm link
项 在 examples/get-access-token.coffee 然后运行 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)
默认 user_id
设置为 self
。
Author
License
MIT 许可证,请参阅包含的 license.md
文件。
4sq
A node.js wrapper for the Foursquare API.
Installation
$ npm install 4sq
Examples
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);
});
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
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)
By default user_id
set to self
.
Author
License
The MIT License, see the included license.md
file.