Guest User

project belajar bot

a guest
Jan 30th, 2016
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <?php
  2. $token = file_get_contents("token.txt");
  3.  
  4.  
  5.  
  6. $ips = '104.219.248.23';
  7. $secret = 'a0322a2844bb46aca29983b8599e33e8';
  8.  
  9. $signature = (hash_hmac('sha256', $ips, $secret, false));
  10. $header = join('|', array($ips, $signature));
  11.  
  12.  
  13.  
  14. function curl($url, $post = null) {
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_URL, $url);
  17. if ($post != null) {
  18. curl_setopt($ch, CURLOPT_POST, true);
  19. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  20. }
  21. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  22.  
  23. curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Insta-Forwarded-For:'.$header));
  24. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  25. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  26. $exec = curl_exec($ch);
  27. curl_close($ch);
  28. return $exec;
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. $curl = curl("https://api.instagram.com/v1/users/self/feed?count=3&access_token=" . $token);
  37. $ngirim = json_decode($curl);
  38. foreach ($ngirim->data as $data) {
  39. $lampu = $data->username;
  40. $cahaya = curl("https://api.instagram.com/v1/media/" . $data->id . "/likes", array(
  41. "access_token" => $token
  42. ));
  43. $ngirim = json_decode($cahaya);
  44.  
  45.  
  46. if ($ngirim->meta->code == "200")
  47. echo "[WORK]";
  48. else
  49. echo "[FAIL]";
  50. sleep(2);
  51.  
  52. }
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment