Advertisement
Guest User

ternatip.php

a guest
Jun 13th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 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.  
  12. preg_match_all('%Set-Cookie: (.*?);%',$login[0],$d);$cookie = '';
  13. for($o=0;$o<count($d[0]);$o++)$cookie.=$d[1][$o].";";
  14.    
  15. if(preg_match("/sessionid/", $cookie)){
  16.     $apinya = curl('https://www.instagram.com/'.$username.'/?__a=1'); $hpr = json_decode($apinya, 1);
  17.     $user_id = $hpr['user']['id'];
  18.     print 'ADA SESI<br><br>';
  19.     print 'User id : '.$user_id.'<br>';
  20.     print 'Useragent : '.$ua.'<br>';
  21.     print 'Cookie : '.$cookie.'<br>';
  22.     //MASUKKIN METODE INSET DB DISINI
  23. }else{
  24.     print 'GA ADA SESI<br>';
  25. }
  26.  
  27. function curl($dhan, $cha=null) {
  28.     $love = curl_init();
  29.     curl_setopt($love, CURLOPT_URL, $dhan);
  30.     if($cha != null){
  31.         curl_setopt($love, CURLOPT_POST, true);
  32.         curl_setopt($love, CURLOPT_POSTFIELDS, $cha);
  33.     }
  34.     curl_setopt($love, CURLOPT_FOLLOWLOCATION, true);
  35.     curl_setopt($love, CURLOPT_RETURNTRANSFER, true);
  36.     curl_setopt($love, CURLOPT_SSL_VERIFYPEER, false);
  37.     $hmm = curl_exec($love);
  38.     curl_close($love);
  39.     return $hmm;
  40. }
  41.  
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement