-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot.js
67 lines (57 loc) · 2.67 KB
/
bot.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
var dotenv = require('dotenv').config()
var _ = require('lodash');
var Client = require('node-rest-client').Client;
var Twit = require('twit');
var async = require('async');
var emoji = require('node-emoji');
var lyrics = [
["Last Christmas, I gave you my heart But the very next day, you gave it away"],
["This year, to save me from tears I'll give it to someone special"],
["Last Christmas, I gave you my heart But the very next day, you gave it away"],
["This year, to save me from tears I'll give it to someone special (special)"],
["Once bitten and twice shy I keep my distance but you still catch my eye"],
["Tell me baby do you recognize me? Well it's been a year, it doesn't surprise me"],
["I wrapped it up and sent it With a note saying 'I Love You' I meant it"],
["Now I know what a fool I've been But if you kissed me now I know you'd fool me again"],
["Last Christmas, I gave you my heart But the very next day, you gave it away"],
["This year, to save me from tears I'll give it to someone special (special)"],
["Last Christmas, I gave you my heart But the very next day, you gave it away"],
["This year, to save me from tears I'll give it to someone special (special)"],
["A face on a lover with a fire in his heart A man undercover but you tore him apart"],
["Maybe next year, I'll give it to someone, I'll give it to someone special"],
["Special, someone, someone I'll give it to someone, I'll give it to someone special"],
["Who'll give me something in return I'll give it to someone, hold my heart and watch it burn"],
["I'll give it to someone, I'll give it to someone special I thought you were here to stay"],
["How can love be for a day? I thought you were someone special, gave you my heart"],
["I'll give it to someone, I'll give it to someone"],
["Last Christmas I gave you my heart You gave it away"],
["I'll give it to someone, I'll give it to someone"]
];
console.log(process.env)
var t = new Twit({
consumer_key: process.env['12DAYSOFWHAM_TWIT_CONSUMER_KEY'],
consumer_secret: process.env['12DAYSOFWHAM_TWIT_CONSUMER_SECRET'],
access_token : process.env['12DAYSOFWHAM_TWIT_ACCESS_TOKEN'],
access_token_secret : process.env['12DAYSOFWHAM_TWIT_ACCESS_TOKEN_SECRET']
});
var ref_index = -1;
var printLine = function(){
if (ref_index < 20) {
ref_index += 1;
}
else{
ref_index = 0;
};
var emojify1 = emoji.random().emoji
var emojify2 = emoji.random().emoji
var tweet = {
status: (emojify1 + " " + lyrics[ref_index].toString() + ' ' + emojify2)
};
return tweet
};
var post = function() {
t.post('statuses/update', printLine(), function(err, data, response){
console.log(data);
});
}
setInterval(post, 60000 * 60);