-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.js
More file actions
50 lines (44 loc) · 1.19 KB
/
bot.js
File metadata and controls
50 lines (44 loc) · 1.19 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
console.log("Hello user, the SCC bot is online")
var Twit = require('twit');
var config = require('./config');
var T = new Twit(config);
var tweet = {
status: 'Hi @lespinalrivera! What did you code today? #Surreycodes'
}
T.post('statuses/update', tweet, tweeted);
function tweeted(err, data, response) {
if (err) {
console.log('could not be tweeted');
} else {
console.log("I'm ALIVE!!");
}
}
// var retweet = function() {
// var params = {
// q: '#surreycode, #surreycodes, #surreycodecamp',
// result_type: 'recent',
// lang: 'en'
// }
//
// T.get('search/tweets', params, gotData);
//
// function gotData(err, data, response) {
// if (!err) {
// var retweetId = data.statuses[0].id_str;
// Twitter.post('statuses/retweet/:id', {
// id:retweetId
// }, function(err, response) {
// if (response) {
// console.log('Retweeted!');
// }
// if (err) {
// console.log('I Could not Retweet :( Something is wrong.')
// }
// });
// }
// else {
// console.log('uh oh, something went wrong while searching')
// }
// }
//
// }