JackHaxor

Bot alert hashtag chmod 777 full access . hashtag cm

Aug 14th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. error_reporting(0);
  4. define('HASHTAG_NAMESPACE', '#j2team');/* Sửa hashtag tại đây , chữ thường không viết hoa*/
  5. $token = 'token';
  6. $idgroup = '1665434437020609'; /* Id Group */
  7. $post = json_decode(request('https://graph.facebook.com/v2.9/' .$idgroup. '/feed?fields=id,message,created_time,from&limit=1000&access_token=' . $token), true); /* Get Data Post*/
  8. $timelocpost = date('Y-m');
  9. $danhsachtukhoa = array('đm', 'cc', 'fuck', 'dm', 'óc chó');
  10. $logcmt = file_get_contents("logcmt.txt");
  11. $logpost= file_get_contents("log.txt");
  12. for ($i = 0; $i < 1000; $i++) {
  13. $idpost = $post['data'][$i]['id'];
  14. $messagepost = $post['data'][$i]['message'];
  15. $time = $post['data'][$i]['created_time'];
  16.  
  17. if (strpos($time, $timelocpost) !== false) {
  18. /* Check hashtag */
  19. if (strpos(strtolower($messagepost), HASHTAG_NAMESPACE) === FALSE) {
  20.  
  21. if (strpos($logpost, $idpost) === FALSE) {
  22. $arraycmt = array('Bổ sung #hashtag vào bài viết nhé, ' . $post['data'][$i]['from']['name'] . '!' . "\n\n" . 'Link : https://community.j2.team/hashtags.html',
  23. 'Ơi bạn gì đó ơi quên thêm #hashtag kìa ' . "\n\n" . ' Link : https://community.j2.team/hashtags.html',
  24. 'Bạn bè anh em tin tưởng bạn mà bạn lại quên #hashtag thế à ' . $post['data'][$i]['from']['name'] . ' ! Bổ sung #hashtag ngay nào' . "\n\n" . 'Link : https://community.j2.team/hashtags.html'
  25.  
  26. );
  27. $random_cmt = array_rand($arraycmt);
  28. $comment = $arraycmt[$random_cmt];
  29. request('https://graph.facebook.com/' . urlencode($idpost) . '/comments?method=post&message=' . urlencode($comment) . '&access_token=' . $token);
  30. $luulog = fopen("log.txt", "a");
  31. fwrite($luulog, $idpost . "\n");
  32. fclose($luulog);
  33. } else {
  34. echo 'Đã nhắc hashtag';
  35. }
  36. }
  37. /* END Check hashtag */
  38.  
  39. /* Scan cmt */
  40. $getcmt = json_decode(request('https://graph.facebook.com/v2.9/' . $idpost . '?fields=comments.summary(true).limit(10000){message}&access_token=' . $token), true);
  41. $count = $getcmt['comments']['summary']['total_count'];
  42. for ($a = 0; $a < $count; $a++) {
  43. $cmt = $getcmt['comments']['data'][$a]['message'];
  44. $idcmt = $getcmt['comments']['data'][$a]['id'];
  45. $cmtcham = array(".", "..", "...", "....");
  46. if (in_array($cmt, $cmtcham)) {
  47. if (strpos($logcmt, $idcmt) === FALSE) {
  48.  
  49. $comment = 'Chấm sẽ bị ban bạn nhé';
  50. request('https://graph.facebook.com/' . urlencode($idcmt) . '/comments?method=post&message=' . urlencode($comment) . '&access_token=' . $token);
  51. $luulog = fopen("logcmt.txt", "a");
  52. fwrite($luulog, $idcmt . "\n");
  53. fclose($luulog);
  54.  
  55. }
  56. }
  57.  
  58.  
  59.  
  60.  
  61. /* Scan reply cmt */
  62. $getrepcmt = json_decode(request('https://graph.facebook.com/v2.9/' . $idcmt . '?fields=comments.summary(true).limit(10000){message}&access_token=' . $token), true);
  63. $count_repcmt = $getrepcmt['comments']['summary']['total_count'];
  64. for ($b = 0; $b < $count_repcmt; $b++) {
  65. $cmtrep = $getrepcmt['comments']['data'][$b]['message'];
  66. $idcmtrep = $getrepcmt['comments']['data'][$b]['id'];
  67. $lamoscar1 = " " . strtolower($cmtrep);
  68. if(strposa($lamoscar1, $danhsachtukhoa, 1)) {
  69. if (strpos($logcmt, $idcmtrep) === FALSE) {
  70. $getinfo_user = json_decode(request('https://graph.facebook.com/v2.9/' . $idcmtrep . '?access_token=' . $token), true);
  71. $name = $getinfo_user["from"]["name"];
  72. $comment = 'Nè ' . $name . ' cmt từ cấm kìa ';
  73. request('https://graph.facebook.com/' . urlencode($idcmt) . '/comments?method=post&message=' . urlencode($comment) . '&access_token=' . $token);
  74. $luulog = fopen("logcmt.txt", "a");
  75. fwrite($luulog, $idcmtrep . "\n");
  76. fclose($luulog);
  77. }else{
  78. echo 'Đã nhắc nhở';
  79.  
  80. }
  81. }
  82. /* END Scan reply cmt */
  83.  
  84. }
  85. $lamoscar = " " . strtolower($cmt);
  86. if(strposa($lamoscar, $danhsachtukhoa, 1)) {
  87. if (strpos($logcmt, $idcmt) === FALSE) {
  88. $arraycmt = array('Chửi bậy à', 'Văn hoá tý đi bạn :v', 'Khẻ nào cưng', 'Xoá cmt hoặc lên vip'); //array cmt
  89. $random_cmt = array_rand($arraycmt);
  90. $comment = $arraycmt[$random_cmt];
  91. request('https://graph.facebook.com/' . urlencode($idcmt) . '/comments?method=post&message=' . urlencode($comment) . '&access_token=' . $token);
  92. $luulog = fopen("logcmt.txt", "a");
  93. fwrite($luulog, $idcmt . "\n");
  94. fclose($luulog);
  95. }else{
  96. echo 'Đã nhắc nhở';
  97.  
  98. }
  99. }
  100.  
  101. }
  102. /* END Scan cmt */
  103. }
  104. }
  105.  
  106.  
  107.  
  108. function strposa($haystack, $needles=array(), $offset=0) {
  109. $chr = array();
  110. foreach($needles as $needle) {
  111. $res = strpos($haystack, $needle, $offset);
  112. if ($res !== false) $chr[$needle] = $res;
  113. }
  114. if(empty($chr)) return false;
  115. return min($chr);
  116. }
  117. function request($url)
  118. {
  119. if (!filter_var($url, FILTER_VALIDATE_URL)) {
  120. return FALSE;
  121. }
  122.  
  123. $options = array(
  124. CURLOPT_URL => $url,
  125. CURLOPT_RETURNTRANSFER => TRUE,
  126. CURLOPT_HEADER => FALSE,
  127. CURLOPT_FOLLOWLOCATION => TRUE,
  128. CURLOPT_ENCODING => '',
  129. CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36',
  130. CURLOPT_AUTOREFERER => TRUE,
  131. CURLOPT_CONNECTTIMEOUT => 15,
  132. CURLOPT_TIMEOUT => 15,
  133. CURLOPT_MAXREDIRS => 5,
  134. CURLOPT_SSL_VERIFYHOST => 2,
  135. CURLOPT_SSL_VERIFYPEER => 0
  136. );
  137.  
  138. $ch = curl_init();
  139. curl_setopt_array($ch, $options);
  140. $response = curl_exec($ch);
  141. $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  142. curl_close($ch);
  143. unset($options);
  144. return $http_code === 200 ? $response : FALSE;
  145. }
  146. ?>
Advertisement
Add Comment
Please, Sign In to add comment