Skip to content

Commit 5844c4e

Browse files
authored
Create bot.gs
First commit (create bot.gs)
1 parent e1fbddb commit 5844c4e

1 file changed

Lines changed: 115 additions & 0 deletions

File tree

bot.gs

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
var robots = [
2+
3+
{
4+
5+
"kuki": "taruh cookies Facebook disini",
6+
7+
"type": 7 // like = 1, love = 2, wow = 3, haha = 4, sad = 7, angry = 8, care = 16
8+
9+
}
10+
11+
];
12+
13+
var aing = {
14+
15+
getUserById: function(id) {
16+
var a = aing.sp.getProperty("uid_" + id);
17+
if (a) {
18+
a = JSON.parse(a)
19+
}
20+
return a
21+
},
22+
23+
strstr: function(a, b, c) {
24+
var d = 0;
25+
a += "";
26+
d = a.indexOf(b);
27+
if (d === -1) {
28+
return false
29+
} else {
30+
if (c) {
31+
return a.substr(0, d)
32+
} else {
33+
return a.slice(d)
34+
}
35+
}
36+
},
37+
38+
getbetween: function(a, b, c) {
39+
var d = a.split(b);
40+
if (d[1]) {
41+
var e = d[1].split(c);
42+
if (e[0]) {
43+
return e[0]
44+
} else {
45+
return ""
46+
}
47+
}
48+
},
49+
50+
51+
52+
beranda: function() {
53+
54+
var prp = {
55+
"muteHttpExceptions": true,
56+
"method": "GET",
57+
"followRedirects": false,
58+
"headers": {
59+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) Gecko/20100101 Firefox/54.0"
60+
}
61+
};
62+
63+
if (robots[0].kuki) {
64+
prp.headers.cookie = robots[0].kuki
65+
}
66+
67+
var fetch = UrlFetchApp.fetch("https://mbasic.facebook.com/home.php?sk=h_chr", prp);
68+
69+
return fetch.getContentText();
70+
71+
}
72+
73+
};
74+
75+
function mulai() {
76+
77+
var prp = {
78+
"muteHttpExceptions": true,
79+
"method": "GET",
80+
"followRedirects": false,
81+
"headers": {
82+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) Gecko/20100101 Firefox/54.0"
83+
}
84+
};
85+
86+
if (robots[0].kuki) {
87+
prp.headers.cookie = robots[0].kuki
88+
}
89+
90+
var a = aing.beranda(),
91+
b = aing.strstr(a, "id=\"m-top-of-feed\">"),
92+
c = b.split("/reactions/picker/");
93+
94+
for (x in c) {
95+
96+
var d = aing.getbetween(c[x], "ft_id=", "&");
97+
98+
if (d != null && d !== "") {
99+
100+
var e = UrlFetchApp.fetch("https://mbasic.facebook.com/reactions/picker/?ft_id=" + d, prp),
101+
f = e.getContentText().replace(/&/g, "&");
102+
103+
var g = aing.getbetween(f, "/ufi/reaction/?ft_ent_identifier=" + d + "&reaction_type=" + robots[0].type, "\" style=\"display:block\">");
104+
105+
var h = UrlFetchApp.fetch("https://m.facebook.com/ufi/reaction/?ft_ent_identifier=" + d + "&reaction_type=" + robots[0].type + g, prp);
106+
107+
if (h.getResponseCode() == 302.0) {
108+
Logger.log(d + " -> OK")
109+
}
110+
111+
}
112+
113+
}
114+
115+
}

0 commit comments

Comments
 (0)