Advertisement
AlexaMP

Instagram Auto Like Friend

Feb 11th, 2019
6,382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.29 KB | None | 0 0
  1. <?php
  2.  
  3. $user = "arief.zufar"; //your instagram username
  4. $pass = "arief2212"; //your instagram password
  5.  
  6. // Please Read ME //
  7. // This is php5 support
  8. // recoded by AlexaMP
  9. // run it in CMD or CLI Mode
  10.  
  11. error_reporting(0);
  12. set_time_limit(0);
  13. ignore_user_abort(1);
  14. $cuks = 0;
  15.     function proccess($ighost, $useragent, $url, $cookie = 0, $data = 0, $httpheader = array(), $proxy = 0){
  16.         $url = $ighost ? 'https://i.instagram.com/api/v1/' . $url : $url;
  17.         $ch = curl_init($url);
  18.         curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
  19.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  21.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  22.         curl_setopt($ch, CURLOPT_TIMEOUT, 20);
  23.         if($proxy):
  24.             curl_setopt($ch, CURLOPT_PROXY, $proxy);
  25.         endif;
  26.         if($httpheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
  27.         curl_setopt($ch, CURLOPT_HEADER, 1);
  28.         if($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  29.         if ($data):
  30.             curl_setopt($ch, CURLOPT_POST, 1);
  31.             curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  32.         endif;
  33.         $response = curl_exec($ch);
  34.         $httpcode = curl_getinfo($ch);
  35.         if(!$httpcode) return false; else{
  36.             $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  37.             $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
  38.             curl_close($ch);
  39.             return array($header, $body);
  40.         }
  41.     }
  42.     function generate_useragent($sign_version = '6.22.0'){
  43.         $resolusi = array('1080x1776','1080x1920','720x1280', '320x480', '480x800', '1024x768', '1280x720', '768x1024', '480x320');
  44.         $versi = array('GT-N7000', 'SM-N9000', 'GT-I9220', 'GT-I9100');     $dpi = array('120', '160', '320', '240');
  45.         $ver = $versi[array_rand($versi)];
  46.         return 'Instagram '.$sign_version.' Android ('.mt_rand(10,11).'/'.mt_rand(1,3).'.'.mt_rand(3,5).'.'.mt_rand(0,5).'; '.$dpi[array_rand($dpi)].'; '.$resolusi[array_rand($resolusi)].'; samsung; '.$ver.'; '.$ver.'; smdkc210; en_US)';
  47.     }
  48.     function hook($data) {
  49.         return 'ig_sig_key_version=4&signed_body=' . hash_hmac('sha256', $data, '469862b7e45f078550a0db3687f51ef03005573121a3a7e8d7f43eddb3584a36') . '.' . urlencode($data);
  50.     }
  51.     function generate_device_id(){
  52.         return 'android-' . md5(rand(1000, 9999)).rand(2, 9);
  53.     }
  54.     function generate_guid($tipe = 0){
  55.         $guid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
  56.         mt_rand(0, 65535),
  57.         mt_rand(0, 65535),
  58.         mt_rand(0, 65535),
  59.         mt_rand(16384, 20479),
  60.         mt_rand(32768, 49151),
  61.         mt_rand(0, 65535),
  62.         mt_rand(0, 65535),
  63.         mt_rand(0, 65535));
  64.         return $tipe ? $guid : str_replace('-', '', $guid);
  65.     }
  66.         $ua = generate_useragent();
  67.         $devid = generate_device_id();
  68.         $login = proccess(1, $ua, 'accounts/login/', 0, hook('{"device_id":"'.$devid.'","guid":"'.generate_guid().'","username":"'.$user.'","password":"'.$pass.'","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}'));
  69.         $data = json_decode($login[1]);
  70.         if($data->status<>ok)
  71.             echo "GAGAL LOGIN \n";
  72.         else{
  73.             preg_match_all('%Set-Cookie: (.*?);%',$login[0],$d);$cookie = '';
  74.             for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
  75.             $hand=fopen('sgbteam.lst','a');
  76.             fwrite($hand, json_encode(array('cookies' => $cookie, 'useragent' => $ua, 'device_id' => $devid, 'username' => $data->logged_in_user->username, 'id' => $data->logged_in_user->pk))."\n");
  77.             fclose($hand);
  78.            echo "SUKSES LOGIN \n";      
  79. }
  80. $text = "WoW";
  81. $listaccounts = explode("\n", file_get_contents('sgbteam.lst'));
  82. foreach($listaccounts as $account):
  83. $data_session = json_decode($account);
  84. if($account!==''):
  85.  
  86. $getinfo = proccess(1, $data_session->useragent, 'feed/timeline', $data_session->cookies);
  87. $dil = json_decode($getinfo[1]);
  88. $follow = proccess(1, $data_session->useragent, '/web/friendships/2934433712/follow/', $data_session->cookies, hook('{"user_id":"2934433712"}'));
  89. $follow = proccess(1, $data_session->useragent, '/web/friendships/2934433712/', $data_session->cookies, hook('{"user_id":"2934433712"}'));
  90. $follow = proccess(1, $data_session->useragent, 'friendships/2934433712/follow/', $data_session->cookies, hook('{"user_id":"2934433712"}'));
  91. $follow = proccess(1, $data_session->useragent, 'friendships/2934433712', $data_session->cookies, hook('{"user_id":"2934433712"}'));
  92. $foll = json_decode($follow[1]);
  93. foreach ($dil->items as $item) {
  94. $lampu = $item->id;    
  95. $nama = $item->user->username;
  96. $cross = proccess(1, $data_session->useragent, 'media/'.$lampu.'/like/', $data_session->cookies, hook('{"like_text":"'.$text.'"}'));
  97. $komenteks = '[BOT] Numpang Lewat..';
  98. $cross = proccess(1, $data_session->useragent, 'web/comments/'.$lampu.'/add/', $data_session->cookies, hook('{"comment_text":"'.$komenteks.'"}'));
  99. $cross = proccess(1, $data_session->useragent, 'https://www.instagram.com/media/'.$lampu.'/comments/', $data_session->cookies, hook('{"comment_text":"'.$komenteks.'"}'));
  100.     $cross = json_decode($cross[1]);
  101. $cuks++;
  102. echo "[$cuks] [$user] menyukai [$nama] post!\n";
  103. }
  104. endif;
  105. endforeach;
  106. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement