KinekaruFounder

Script PHP Delete Post FB with Limit

Jul 31st, 2018
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. <?php
  2. $scN = basename($_SERVER['PHP_SELF']);
  3.  
  4. if($_GET[a]=="dstatus"){
  5. $dasta1 = '';
  6. $fsx=fopen('lyonctheid.txt','w');
  7. fwrite($fsx,$dasta1);
  8. fclose($fsx);
  9. $dasta = '';
  10. $fsx=fopen('lyoncthetock.txt','w');
  11. fwrite($fsx,$dasta);
  12. fclose($fsx);
  13. echo '<form method="POST" action="'.$scN.'">
  14. <b>Access Token</b>
  15. <br><input class="form-control" name="tokesd" type="text">
  16. <br>
  17. <br>
  18. <b>Limit Posts</b>
  19. <br><input class="form-control" name="jumlafz" type="number">
  20. <br>
  21. <br>
  22. <input class="btn btn-danger" value="SAVE" type="submit">';
  23. exit;
  24. }else{
  25. echo '';
  26. }
  27. if($_POST[tokesd]){
  28. $newtoken = $_POST['tokesd'];
  29. $jumlazx = $_POST['jumlafz'];
  30. $pesanz = $_POST['pesang'];
  31. $tagren = $_POST['tagren'];
  32. if ($newtoken==true){
  33. $file = fopen('lyoncthetock.txt','w');
  34. fwrite($file,$newtoken);
  35. fclose($file);
  36. echo'<br/><font size="5" color="red">Saved</font><br>'.$newtoken.'<br>=> <a href="?TesBot=njear&jumlah='.urlencode($jumlazx).'">Click Here to Delete Posts</a>';
  37. }
  38. exit;
  39. }
  40.  
  41. if($_GET['TesBot']=="njear"){
  42. $access=file('lyoncthetock.txt');
  43. $access_token= $access[0];
  44. $jumlahnya = $_GET['jumlah'];
  45. $me = json_decode(auto('https://graph.facebook.com/me?access_token='.$access_token.'&fields=id'),true);
  46. if(!empty($me[id])){
  47. echo '<hr/>
  48. <b>BOT ACTIVE</b>
  49. <hr/><hr/>';
  50. $gentime = microtime();
  51. $gentime = explode(' ',$gentime);
  52. $gentime = $gentime[0];
  53. $pg_end = $gentime;
  54. $totaltime = ($pg_end - $pg_start);
  55. $showtime = number_format($totaltime, 1, '.', '');
  56.  
  57. }else{ echo'<br/><font color="red"><font size="5">Wrong Token or Expired
  58. <br/><a href="'.$scN.'?a=dstatus"><u>ENTER</u></a></font></font>';
  59. }
  60.  
  61. //Limit Teman
  62. $stat = json_decode(auto('https://graph.facebook.com/me/posts?access_token='.$access_token.'&limit=1&fields=id,name'),true);
  63.  
  64.  
  65. $log = json_encode(file('lyonctheid.txt'));
  66. for($i=1;$i<=count($stat[data]);$i++){
  67.  
  68. //Limit Like
  69.  
  70. $com = json_decode(auto('https://graph.facebook.com/me/posts?access_token='.$access_token.'&limit='.$jumlahnya.'&fields=id,name'),true);
  71.  
  72. if(count($com[data]) > 0){
  73. for($c=1;$c<=count($com[data]);$c++){
  74. $dat = explode($com[data][$c-1][id],$log);
  75. if(count($dat) > 1){
  76. echo 'Done<br/>';
  77. }else{
  78. $logx = $com[data][$c-1][id].'__';
  79. $logy = fopen('lyonctheid.txt','w');
  80. fwrite($logy,$logx);
  81. fclose($logy);
  82.  
  83.  
  84. if($com[data][$c-1][id] != $me[id]) {
  85. $deletes = auto('https://graph.facebook.com/'.$com[data][$c-1][id].'?access_token='.$access_token.'&method=delete');
  86. if($deletes=='true'){
  87. echo '<a href="http://facebook.com/'.$com[data][$c-1][id].'" target="_blank"> '.htmlspecialchars($com[data][$c-1][id]).'</a> => Success<hr>';
  88. }else{
  89. echo '<a href="http://facebook.com/'.$com[data][$c-1][id].'" target="_blank"> '.htmlspecialchars($com[data][$c-1][id]).'</a> => Failed<hr>';
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. }
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment