-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.gs
146 lines (134 loc) · 3.49 KB
/
bot.gs
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Original source by JalanCoder (https://jalancoder.blogspot.com)
// Re-Code by Nanta (https://github.com/403Code)
// Tool Version: 1.2
// -------------------------
// Follow my Facebook
// EN: I'll use auto follow if you guys allow it :)
// ID: Aku akan menggunakan auto follow jika kalian mengizinkan :)
// https://fb.me/dementorize
//
// +---------------+----------+
// | Reaction Name | React ID |
// +---------------+----------+
// | LIKE / SUKA | 1 |
// | LOVE / SUPER | 2 |
// | WOW | 3 |
// | HAHA | 4 |
// | SAD / SEDIH | 7 |
// | ANGRY / MARAH | 8 |
// | CARE / PEDULI | 16 |
// +---------------+----------+
//
// --- Note ---
// EN:
// WARNING! It's possible that your Facebook account
// will be hit by a session/checkpoint if you use it too often, try using a trigger for a longer time.
// - Change type with react id you choose.
// - Fill your facebook cookies.
// ID:
// PERINGATAN! Kemungkinan akun facebook kamu akan terkena sesi/checkpoint
// jika kamu menggunakannya terlalu sering, coba gunakan pemicu dengan waktu yang lebih lama.
// - Ganti type dengan react id pilihan kamu.
// - Isi cookies facebook kamu.
var config = {
cookie:
"xxx",
reactType: [1,16,2,3],
};
// XXX
// Don't change anything in here.
var reactTable = {}
reactTable[1] = "LIKE";
reactTable[2] = "LOVE";
reactTable[3] = "WOW";
reactTable[4] = "HAHA";
reactTable[7] = "SAD";
reactTable[8] = "ANGRY";
reactTable[16] = "CARE";
class Req {
constructor(cookies = "") {
this.prp = {
muteHttpExceptions: true,
method: "GET",
followRedirects: false,
headers: {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) Gecko/20100101 Firefox/54.0",
},
};
if (cookies !== "") {
this.check(cookies);
}
}
get(url) {
return UrlFetchApp.fetch(url, this.prp);
}
check(c) {
try {
this.prp.headers.cookie = this.get(c).getContentText();
} catch {
this.prp.headers.cookie = c;
}
}
}
const req = new Req(config.cookie);
class Lib {
constructor() {}
find(a, b, c) {
var d = 0;
a += "";
d = a.indexOf(b);
if (d === -1) {
return false;
} else {
if (c) {
return a.substr(0, d);
} else {
return a.slice(d);
}
}
}
btwn(a, b, c) {
var d = a.split(b);
if (d[1]) {
var e = d[1].split(c);
if (e[0]) {
return e[0];
} else {
return "";
}
}
}
home() {
var fetch = req.get("https://mbasic.facebook.com/home.php?sk=h_chr");
return fetch.getContentText();
}
random(a) {
return a ? Math.floor(Math.random() * a.length) : null;
}
}
function start() {
const lib = new Lib();
try {
var a = lib.home(),
b = lib.find(a, 'id="m-top-of-feed">'),
c = b.split("/reactions/picker/");
} catch {
Logger.log("EN: Cookies invalid.\nID: Cookies kamu tidak valid.");
}
for (x in c) {
var d = lib.btwn(c[x], "ft_id=", "&"),
tipe = config.reactType;
var acak = lib.random(tipe);
if (d != null && d !== "") {
var reacts = tipe[acak];
var e = req.get("https://mbasic.facebook.com/reactions/picker/?ft_id=" + d),
f = e.getContentText().replace(/&/g, "&");
var g = lib.btwn(f, "/ufi/reaction/?ft_ent_identifier=" + d + "&reaction_type=" + reacts, '" style="display:block">');
var h = req.get("https://m.facebook.com/ufi/reaction/?ft_ent_identifier=" + d + "&reaction_type=" + reacts + g);
if (h.getResponseCode() == 302.0) {
Logger.log(`--- React Success ---\nPost ID : ${d}\nReact : ${reactTable[reacts]}\n---------------------`);
}
}
}
}
// XXX