forked from J2TeamNNL/J2Team-Community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_summary_follower_from_friend_of_id.html
77 lines (74 loc) · 2.33 KB
/
get_summary_follower_from_friend_of_id.html
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
<!DOCTYPE html>
<html>
<head>
<title>Count Reaction Post</title>
</head>
<body>
<h3>Nhập token của bạn: <a href="https://www.facebook.com/groups/j2team.community/search/?query=token" target="_blank"> Tìm kiếm trên nhóm J2Team Community</a></h3>
<input type="text" id="token" placeholder="EAAA..." value=""><br>
<h3>Nhập id người mà muốn lấy danh sách bạn bè: <a href="https://findmyfbid.com" target="_blank">Tìm trên findmyfbid.com</a></h3>
<input type="number" id="id_person" placeholder="1000...." value=""><br>
<br>
<button>OK</button>
<h1>Số lượng theo dõi của bạn bè</h1>
<table>
<thead>
<th>
ID
</th>
<th>
Lượng người theo dõi
</th>
</thead>
</table>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.js"></script>
<script>
let token, id_person, array_id_friend = [], length_array, i, string_id='', link;
var t = $('table').DataTable();
$(document).ready(function(){
$("button").click(function(e){
e.stopPropagation();
token = $("#token").val();
id_person = $("#id_person").val();
link = `https://graph.facebook.com/${id_person}/friends?limit=5000&fields=id&access_token=${token}`;
$.ajax({
url: link,
dataType: 'json'
})
.done(function(response) {
$.each(response.data, function(index,each){
array_id_friend.push(each.id);
});
length_array = array_id_friend.length;
for(i=1;i<=length_array;i++){
string_id += array_id_friend[i]+',';
if(i%20==0){
string_id = string_id.substring(0, string_id.length - 1);
getSubscriber(string_id);
string_id = '';
}
}
string_id = string_id.substring(0, string_id.length - 1);
getSubscriber(string_id);
});
});
});
function getSubscriber(string_id){
link = `https://graph.facebook.com/subscribers?ids=${string_id}&access_token=${token}&limit=0&summary=true`;
$.ajax({
url: link,
dataType: 'json'
})
.done(function(response) {
$.each(response, function(index,each){
t.row.add( [
`<a href="https://fb.com/${index}" target="_blank">fb.com/${index}</a>`,
each.summary.total_count
] ).draw( true );
})
});}
</script>
</body>
</html>