4square-venues 中文文档教程
4square
4Square Venues 的简单模块
npm install 4square-venues
Notes
该模块(目前)不会进行 oAuth 令牌交换以获取您的 oAuth 访问令牌,假设这是已知的并存储在数据库或其他东西中。
只有破坏性调用(例如 addVenue() 或 editVenue())才需要 oAuth 访问令牌。
Examples
var foursquare = new require('4square-venues')(CLIENT_ID, CLIENT_SECRET, [OAUTH_ACCESS_TOKEN], [API_DATE_VERSION]);
var addParams = { ... }
foursquare.addVenue(addParams, function(err, data) {
if (err) {
console.log(err);
} else {
console.log(data);
}
});
Methods
foursquare.addVenue(选择,回调)
foursquare.getVenue(选择,回调)
foursquare.getCategories(选择,回调)
foursquare.editVenue(选择,回调)
foursquare.searchVenues(选择,回调)
4square
Simple Module for 4Square Venues
npm install 4square-venues
Notes
This module will not (as yet) do the oAuth token exchange to get your oAuth access token, it is assumed this is known and stored in a DB or something.
The oAuth access token is only needed for destructive calls such as addVenue() or editVenue().
Examples
var foursquare = new require('4square-venues')(CLIENT_ID, CLIENT_SECRET, [OAUTH_ACCESS_TOKEN], [API_DATE_VERSION]);
var addParams = { ... }
foursquare.addVenue(addParams, function(err, data) {
if (err) {
console.log(err);
} else {
console.log(data);
}
});
Methods
foursquare.addVenue(opts, callback)
foursquare.getVenue(opts, callback)
foursquare.getCategories(opts, callback)
foursquare.editVenue(opts, callback)
foursquare.searchVenues(opts, callback)