-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbot.js
36 lines (33 loc) · 1.11 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
/*
|--------------------------------------------------------------------------
| INITIALIZATION
|--------------------------------------------------------------------------
*/
// Bot
var args = process.argv.slice(2);
var defaultBot = 'odiometro';
var bot = (args && typeof args[0] !== "undefined") ? args[0] : defaultBot;
// Path and ENV
var path = require('path');
global.appRoot = path.resolve(__dirname);
require('dotenv').config();
global.urlBase = process.env.URL_BASE;
global.phantomJsBin = process.env.PHANTOMJS;
global.botName = bot;
global.botConfig = require("./config/" + bot + ".json");
global.phantomJsBin = process.env.PHANTOMJS;
// Libs
var twitter = require("./app/lib/twitter.js");
var OdiometroBot = require("./app/models/OdiometroBot.js");
/*
|--------------------------------------------------------------------------
| CRON
|--------------------------------------------------------------------------
*/
const cron = require("node-cron");
cron.schedule("0 19 * * *", function () {
var hours = 24;
OdiometroBot.initialize(twitter);
OdiometroBot.postResumeTweet(hours, true);
console.log("Daily resume tweet");
});