-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-1.js
More file actions
29 lines (27 loc) · 957 Bytes
/
app-1.js
File metadata and controls
29 lines (27 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var util = require('util'),
twitter = require('twitter');
var twit = new twitter({
consumer_key: 'MsrAEqq42Bom767QusO4318PL',
consumer_secret: 'C3odEyJEEF4UrLFnoj44wtR8f0kWOjpyUS9Ytmp4wxF0RLs3Qw',
access_token_key: '124289477-qNZe9IBb23YNOoL7r5bERIBkM0nV4d4jSr84dDzI',
access_token_secret: '7JnyD1Y1skRmdFJuH24LzywM2GJhjwsxsjp5TtZK1Hwd1'
});
/*
twit.stream('statuses/sample', { language: 'en' }, function(stream) {
stream.on('data', function(data) {
if (data.entities.hashtags) {
for (key in data.entities.hashtags) {
console.log(data.entities.hashtags[key].text);
}
}
});
setTimeout(stream.destroy, 15000);
});
*/
twit.stream('statuses/filter', { language: 'en', track:'#android'}, function(stream) {
stream.on('data', function(data) {
//console.log(util.inspect(data));
console.log(data.text);
});
setTimeout(stream.destroy, 15000);
});