Advertisement
Guest User

ginlog

a guest
Jun 12th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('fungsi.php');
  4. $username = "";
  5. $password = "";
  6. $ua = generate_useragent();
  7. $devid = generate_device_id();
  8.  
  9. $login = proccess(1, $ua, 'accounts/login/', 0, hook('{"device_id":"'.$devid.'","guid":"'.generate_guid().'","username":"'.$username.'","password":"'.$password.'","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}'));
  10. $data = json_decode($login[1]);
  11. preg_match_all('%Set-Cookie: (.*?);%',$login[0],$d);$cookie = '';
  12. for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
  13. if(preg_match("/sessionid/", $cookie)){
  14.     $apinya = curl('https://www.instagram.com/'.$username.'/?__a=1'); $hpr = json_decode($apinya, 1);
  15.     $user_id = $hpr['user']['id'];
  16.     print 'ADA SESI<br><br>';
  17.     print 'User id : '.$user_id.'<br>';
  18.     print 'Useragent : '.$ua.'<br>';
  19.     print 'Cookie : '.$cookie.'<br>';
  20.     //MASUKKIN METODE INSET DB DISINI
  21. }else{
  22.     print 'GA ADA SESI<br>';
  23. }
  24.  
  25. function curl($dhan, $cha=null) {
  26.     $love = curl_init();
  27.     curl_setopt($love, CURLOPT_URL, $dhan);
  28.     if($cha != null){
  29.         curl_setopt($love, CURLOPT_POST, true);
  30.         curl_setopt($love, CURLOPT_POSTFIELDS, $cha);
  31.     }
  32.     curl_setopt($love, CURLOPT_FOLLOWLOCATION, true);
  33.     curl_setopt($love, CURLOPT_RETURNTRANSFER, true);
  34.     curl_setopt($love, CURLOPT_SSL_VERIFYPEER, false);
  35.     $hmm = curl_exec($love);
  36.     curl_close($love);
  37.     return $hmm;
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement