Created
July 3, 2018 11:39
-
-
Save annguyendeveloper/a4cb218afe5983aaaaf3dc7c034b953c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set('max_execution_time', 0); | |
| $token = "EAA..."; //token full quyền | |
| $array_avoid = ["179034362668856","123"];//id trang không muốn bỏ thích, 179034362668856 là id trang J2TeaM | |
| $array_pages = array(); | |
| $links = "https://graph.facebook.com/me/likes?fields=id&access_token=$token"; | |
| $curls = curl_init(); | |
| curl_setopt_array($curls, array( | |
| CURLOPT_URL => $links, | |
| CURLOPT_RETURNTRANSFER => true, | |
| CURLOPT_TIMEOUT => 0, | |
| CURLOPT_SSL_VERIFYPEER => false, | |
| CURLOPT_SSL_VERIFYHOST => false | |
| )); | |
| $reply = curl_exec($curls); | |
| curl_close($curls); | |
| $data = json_decode($reply,JSON_UNESCAPED_UNICODE); | |
| $data = $data['data']; | |
| foreach($data as $each){ | |
| $array_pages[] = $each['id']; | |
| } | |
| foreach($array_pages as $each){ | |
| if(!in_array($each,$array_avoid)){ | |
| $links = "https://graph.facebook.com/$each/likes?method=delete&access_token=$token"; | |
| $curls = curl_init(); | |
| curl_setopt_array($curls, array( | |
| CURLOPT_URL => $links, | |
| CURLOPT_RETURNTRANSFER => false, | |
| CURLOPT_TIMEOUT => 0, | |
| CURLOPT_SSL_VERIFYPEER => false, | |
| CURLOPT_SSL_VERIFYHOST => false | |
| )); | |
| curl_exec($curls); | |
| curl_close($curls); | |
| sleep(3); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment