-
Notifications
You must be signed in to change notification settings - Fork 0
/
eQQoes.js
48 lines (48 loc) · 1.23 KB
/
eQQoes.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
/*
--proto stage--
i.e heavy use of console.log
just to be sure everything is going according to plan
*/
var https = require('https')
, nodemailer = require('nodemailer')
, request = require('request')
, follow = require('follow')
, a_e = require('./auto_eQQo.js')
, f_e = require('./final_eQQo.js')
;
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
host: "", // hostname
secureConnection: true, // use SSL
port: 465, // port for secure SMTP
auth: {
user: "",
pass: ""
}
});
//--------------
//
//
// DAEMONS
//
//
// eQQoing starts
var starts = function(){
console.log('eQQoing starts');
follow("localhost:5984/eqqoes/", function(error, change) {
if(!error && change.seq > 34){
console.log("Got change number " + change.seq + ": " + change.id)
console.log("Must be new eQQoers! Imma read db")
a_e();
}
})
};
exports.starts = starts;
// Starting the QloQ
var oQloQ = function(){
console.log('Starting the QloQ')
setInterval(f_e, 5 * 61 * 1000);//in milliseconds
};
exports.oQloQ = oQloQ;
starts();
oQloQ();