forked from J2TeamNNL/J2Team-Community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_friend_group.php
50 lines (50 loc) · 1.69 KB
/
add_friend_group.php
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
<!DOCTYPE html>
<html>
<head>
<title>Add Friend</title>
</head>
<body>
<h4>Code để kết bạn với 1 nghìn thành viên nhóm</h4>
<form method="post">
<textarea cols="50" name="token" placeholder="Nhập token vào đây"></textarea><br>
<input type=”text” name="id_group" placeholder="Nhập ID nhóm">
<button name="ok">OK</button>
</form>
</body>
</html>
<?php
if(isset($_POST['ok'])){
ini_set('max_execution_time', 0);
$token = $_POST['token'];
$id_group = $_POST['id_group'];
$link = "https://graph.facebook.com/$id_group/members?limit=1000&fields=id&access_token=$token";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $link,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 0,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false
));
$reply = curl_exec($curl);
curl_close($curl);
$data = json_decode($reply,JSON_UNESCAPED_UNICODE);
$data = $data['data'];
$array_all = array_column($data, "id");
foreach ($array_all as $id) {
$link = "https://graph.facebook.com/me/friends?uid=$id&access_token=$token";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $link,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 0,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false
));
curl_exec($curl);
curl_close($curl);
echo "Đã gửi kết bạn với <a href='https://fb.com/$id' target='_blank'>$id</a><br>";
sleep(rand(2,10));
}
}