-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorderbot.js
More file actions
49 lines (39 loc) · 1.34 KB
/
orderbot.js
File metadata and controls
49 lines (39 loc) · 1.34 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
const bb = require('./bestbuy');
const walmart = require('./walmart');
const n = require('./notification');
const email = require('./email')
var AWS = require("aws-sdk");
var toEmail = "[ENTER YOUR EMAIL HERE]";
var awsVerifiedEmail = "[FILL IN VERIFIED EMAIL AS SOURCE]";
AWS.config.getCredentials(function(err) {
if (err) {
console.log(err.stack);
console.log("You need aws credentials before you can use orderbot. See the readme.");
} else {
console.log("Access key:", AWS.config.credentials.accessKeyId);
}
});
if (toEmail == "[ENTER YOUR EMAIL HERE]") {
console.error("ERROR: You need to set your email to send notifications to before using orderbot.js");
process.exit(1);
}
if (awsVerifiedEmail == "[FILL IN VERIFIED EMAIL AS SOURCE]") {
console.error("ERROR: You need to set your verified aws email before using orderbot.js");
process.exit(1);
}
var notifier = new n.Notifier(toEmail, awsVerifiedEmail);
// Best buy
var bbCounter = 0;
bbNotify = function() {
bbCounter++;
bb.CheckSite(notifier, bbCounter);
}
// walmart
// var walmartCounter = 0;
// walmartNotify = function() {
// walmartCounter++;
// walmart.CheckSite(n.NotifyAvailable, n.NotifyUnavailable, walmartCounter);
// }
//email.sendEmail("rocketegg@gmail.com", "www.google.com", "test email");
setInterval(bbNotify, 1000);
//setInterval(walmartNotify, 5000);