Skip to content

Commit 74e6423

Browse files
author
Manuel Eusebio de Paz Carmona
committed
Updating use of private file
1 parent 60eda43 commit 74e6423

3 files changed

Lines changed: 23 additions & 21 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ Thumbs.db
3838
.project
3939
.pydevproject
4040

41+
# Private files #
42+
#################
43+
privateCredentials.json
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
var app = require('express').createServer(),
2-
twitter = require('ntwitter');
1+
var app = require('express').createServer(), twitter = require('ntwitter');
32

43
app.listen(3000);
54

6-
var twit = new twitter({
7-
consumer_key: 'aaaaaaadsfasdf',
8-
consumer_secret: 'adsfasdfañlkjasfdlkjasdf',
9-
access_token_key: 'adsfasdfasdff',
10-
access_token_secret: 'asdfadsfasdfasdfasdf'
11-
});
5+
var credentials = require('./privateCredentials.json');
6+
7+
/*
8+
* Saved in a json private file
9+
{
10+
"consumer_key": "....",
11+
"consumer_secret": "....",
12+
"access_token_key": "......",
13+
"access_token_secret": "...."
14+
}
15+
*/
16+
17+
var twit = new twitter(credentials);
1218

13-
//twit.stream('statuses/filter', { track: ['love', 'hate'] }, function(stream) {
14-
twit.stream('statuses/filter', { track: ['bbva'] }, function(stream) {
15-
stream.on('data', function (data) {
16-
console.log(JSON.stringify(data));
17-
console.log(",")
18-
});
19+
//twit.stream('statuses/filter', { track : [ 'love', 'hate' ] }, function(stream) { // a lot of tweets!!
20+
twit.stream('statuses/filter', { track: ['cristiano ronaldo'] }, function(stream) {
21+
stream.on('data', function(data) {
22+
console.log(JSON.stringify(data));
23+
console.log(",")
24+
});
1925
});

‎P02_nodejsutilities/aws/express_twitter/logs0.txt‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)