chirp-rest ![Build Status](https://travis-ci.org/ddo/chirp-rest.svg)
twitter rest apis in nodejs
![Dependency Status](https://david-dm.org/ddo/chirp-rest.png?theme=shields.io)
![Code Climate](https://codeclimate.com/github/ddo/chirp-rest.png)
Installation
npm i chirp-rest --save
Usage
var ChirpRest = require('./');
var twitter = new ChirpRest({
consumer: {
public: 'xxxxx',
secret: 'xxxxx'
},
token: {
public: 'xxxxx'
secret: 'xxxxx'
}
});
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, body) {
});
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, body) {
});
- get user timeline limit 5
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', {
count: 5
}, function(err, body) {
});
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, body) {
});
twitter.post('https://api.twitter.com/1.1/statuses/update.json', {
status: 'chirp chirp'
}, function(err, body) {
});
https://dev.twitter.com/docs/api/1.1
API
.get(url, parameters, callback)
.post(url, parameters, callback)
Option
url
:String
Twitter api endpointparameters
: Object
Twitter api parameters optional
callback