Socket
Socket
Sign inDemoInstall

chirp-rest

Package Overview
Dependencies
50
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0 to 0.0.1

.coveralls.yml

17

package.json
{
"name": "chirp-rest",
"version": "0.0.0",
"description": "chirp-rest ==========",
"version": "0.0.1",
"description": "twitter rest apis in nodejs",
"main": "index.js",

@@ -24,3 +24,14 @@ "scripts": {

},
"homepage": "https://github.com/ddo/chirp-rest"
"homepage": "https://github.com/ddo/chirp-rest",
"dependencies": {
"debug": "^0.8.1",
"oauth-1.0a": "^0.1.0",
"request": "^2.36.0"
},
"devDependencies": {
"chai": "^1.9.1",
"coveralls": "^2.10.0",
"istanbul": "^0.2.10",
"mocha": "^1.19.0"
}
}

@@ -1,2 +0,89 @@

chirp-rest
==========
chirp-rest [![Build Status](https://travis-ci.org/ddo/chirp-rest.svg)](https://travis-ci.org/ddo/chirp-rest)
==============
> twitter rest apis in nodejs
[![NPM version](https://badge.fury.io/js/chirp-rest.png)](http://badge.fury.io/js/chirp-rest)
[![Dependency Status](https://david-dm.org/ddo/chirp-rest.png?theme=shields.io)](https://david-dm.org/ddo/chirp-rest)
[![Coverage Status](https://coveralls.io/repos/ddo/chirp-rest/badge.png?branch=master)](https://coveralls.io/r/ddo/chirp-rest?branch=master)
[![Code Climate](https://codeclimate.com/github/ddo/chirp-rest.png)](https://codeclimate.com/github/ddo/chirp-rest)
## Installation
```
npm i chirp-rest --save
```
## Usage
```js
var ChirpRest = require('./');
var twitter = new ChirpRest({
consumer: {
public: 'xxxxx',
secret: 'xxxxx'
},
token: {
public: 'xxxxx'
secret: 'xxxxx'
}
});
//get user timeline
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, res, body) {
//body -> tweets
});
```
## [Example](/example.js)
* get user timeline
```js
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, res, body) {
//body -> tweets
});
```
* get user timeline limit 5
```js
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', {
count: 5
}, function(err, res, body) {
//body -> tweets
});
```
* get user timeline
```js
twitter.get('https://api.twitter.com/1.1/statuses/user_timeline.json', function(err, res, body) {
//body -> tweets
});
```
* post new status
```js
twitter.post('https://api.twitter.com/1.1/statuses/update.json', {
status: 'chirp chirp'
}, function(err, res, body) {
//body -> tweet data
});
```
https://dev.twitter.com/docs/api/1.1
## API
* ``.get(url, parameters, callback)``
* ``.post(url, parameters, callback)``
## Option
* ``url``:``String`` Twitter api endpoint
* ``parameters``: ``Object`` Twitter api parameters ``optional``
* ``callback``
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc