chirp-stream
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -21,2 +21,7 @@ var ChirpStream = require('./'); | ||
userstream.on('response', function(res) { | ||
console.log('response'); | ||
console.log(res); | ||
}); | ||
userstream.on('json', function(json) { | ||
@@ -23,0 +28,0 @@ console.log('json'); |
34
index.js
@@ -1,4 +0,3 @@ | ||
var debug = require('debug')('chirp-stream'); | ||
var request = require('request'); | ||
var OAuth = require('oauth-1.0a'); | ||
var debug = require('debug')('chirp-stream'); | ||
var OAuth = require('oauth-request'); | ||
@@ -24,3 +23,4 @@ module.exports = ChirpStream; | ||
this.oauth = OAuth({ | ||
consumer: this.consumer | ||
consumer: this.consumer, | ||
token: this.token | ||
}); | ||
@@ -53,16 +53,18 @@ } | ||
var readable; | ||
var request_data = { | ||
url: url, | ||
method: method, | ||
data: param | ||
}; | ||
if(method === 'GET') { | ||
readable = self.oauth.get({ | ||
url: url, | ||
qs: param, | ||
encoding: 'utf8' | ||
}); | ||
} else { | ||
readable = self.oauth.post({ | ||
url: url, | ||
form: param, | ||
encoding: 'utf8' | ||
}); | ||
} | ||
var readable = request({ | ||
url: request_data.url, | ||
method: request_data.method, | ||
qs: self.oauth.authorize(request_data, self.token), | ||
encoding: 'utf8' | ||
}); | ||
var incomplete_json = []; | ||
@@ -69,0 +71,0 @@ |
{ | ||
"name": "chirp-stream", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "twitter streaming apis in nodejs", | ||
@@ -27,4 +27,3 @@ "main": "index.js", | ||
"debug": "^0.8.1", | ||
"oauth-1.0a": "^0.1.0", | ||
"request": "^2.36.0" | ||
"oauth-request": "0.0.1" | ||
}, | ||
@@ -31,0 +30,0 @@ "devDependencies": { |
@@ -59,5 +59,3 @@ chirp-stream [![Build Status](https://travis-ci.org/ddo/chirp-stream.svg)](https://travis-ci.org/ddo/chirp-stream) | ||
var filterstream = twitter.stream('https://stream.twitter.com/1.1/statuses/filter.json', { | ||
data: { | ||
follow: 61260444 //me :) | ||
} | ||
follow: 61260444 //me :) | ||
}); | ||
@@ -64,0 +62,0 @@ //listen to events... |
@@ -65,4 +65,2 @@ var expect = require('chai').expect; | ||
https://stream.twitter.com/1.1/statuses/filter.json | ||
describe("invalid init", function() { | ||
@@ -69,0 +67,0 @@ it("should throw error", function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12319
2
209
103
+ Addedoauth-request@0.0.1
+ Addedoauth-request@0.0.1(transitive)
- Removedoauth-1.0a@^0.1.0
- Removedrequest@^2.36.0