-
-
Notifications
You must be signed in to change notification settings - Fork 227
/
unfollow_people.html
66 lines (64 loc) · 1.78 KB
/
unfollow_people.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
<!DOCTYPE html>
<html>
<head>
<title>Delete Comment</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
</head>
<body align='center'>
<h3>Nhập token của bạn:
<a href="https://www.facebook.com/groups/j2team.community/search/?query=token" target="_blank">Tìm cách lấy token trong nhóm J2Team Community</a>
</h3>
<input type="text" id="token" placeholder="EAAA..." value=""><br>
<button>OK</button>
<h1>Danh sách đã huỷ theo dõi</h1>
<table>
<thead>
<th>
Tên
</th>
<th>
Ảnh Đại Diện
</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;
var t = $('table').DataTable();
$(document).ready(function(){
$("button").click(function(e){
e.stopPropagation();
token = $("#token").val();
getSubcribers();
});
});
function getSubcribers(){
link = `https://graph.facebook.com/graphql?q=viewer(){actor{subscriptions{nodes{name,id}}}}&access_token=${token}`;
$.ajax({
url: link,
dataType: 'json',
})
.success(function(response) {
$(response.viewer.actor.subscriptions.nodes).each(function(){
unfollow(this.id,this.name);
})
})
}
function unfollow(id,name){
link = `https://graph.facebook.com/${id}/subscribers?method=delete&access_token=${token}`;
$.ajax({
url: link,
dataType: 'json',
})
.success(function() {
t.row.add( [
`<a href="https://fb.com/${id}" target="_blank">${name}</a>`,
`<img src='https://graph.facebook.com/${id}/picture'>`
] ).draw( true );
})
}
</script>
</body>
</html>