-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbots.js
42 lines (37 loc) · 1.02 KB
/
bots.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
var parentBots = []
, childBots = [];
exports.parents = function (index) {
if (typeof index === 'undefined') { return parentBots; }
return parentBots[index];
};
exports.children = function (index) {
if (typeof index === 'undefined') { return childBots; }
return childBots[index];
};
exports.register = function (bot) {
console.log('\n// --------- REGISTERING ------------// \n');
console.log(bot);
if (bot.isParent) { parentBots.push(bot); }
else { childBots.push(bot); }
};
exports.check = function () {
var options = {
url : 'https://en.reddit.com/api/me.json',
headers : {
'User-Agent' : 'skitBot/0.1 by SketchNotSkit',
'X-Modhash' : childBots[0].modhash,
'Cookie' : childBots[0].cookie
},
method : 'GET',
};
request(options, function (err, res, body) {
if (err) {
console.log(err);
return;
} else {
console.log('// ------ //');
console.log(body);
console.log('// ------ //');
}
});
};