makag

Автопубликация предложки + анон или с подписью

Apr 29th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <?php
  2.  
  3. // модерация предложки по айди
  4. $admintoken = '55caa2f4857c21cd5ebdd4e6bc86a4771c56ad708e77e8658f2bb2';//токен админа
  5. $take_guid = '141583321'; //айди паблика цифры
  6. // снова детекторы желания анонимности
  7. $check_anon = array("анон", "антон");
  8.  
  9.  
  10. function vkapi($method) {
  11. $ch = curl_init("https://api.vk.com/method/".$method);
  12. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  13. curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
  14. curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
  15. $response = curl_exec($ch); curl_close($ch); return $response; }
  16.  
  17.  
  18.  
  19.  
  20. $getsuggest = vkapi('wall.get?owner_id=-'.$take_guid.'&offset=0&count=5&filter=suggests&access_token='.$admintoken.'&v=5.60');
  21.  
  22.  
  23. usleep(334000);
  24. $decode_suggest = json_decode($getsuggest,true);
  25. $suggested_items = $decode_suggest['response']['items'];
  26.  
  27. foreach($suggested_items as $item) {
  28. $post_id = $item['id'];
  29. $user_uid = $item['from_id'];
  30. $post_text = $item['text'];
  31.  
  32. // проверяем на желание быть анонимным
  33. foreach ($check_anon as $check){
  34. $is_anon = preg_match("/$check/", "$post_text");
  35. if ($is_anon == 1) { break; } }
  36.  
  37. // ну и подпись ноль или единица
  38. if ($is_anon == 1) { $be_signed = 1; } else { $be_signed = 0; }
  39.  
  40.  
  41. $planirovka = vkapi('wall.post?owner_id=-'.$take_guid.'&signed='.$be_signed.'&post_id='.$post_id.'&filter=suggests&access_token='.$admintoken.'&v=5.60');
  42.  
  43.  
  44.  
  45. usleep(334000); }
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment