Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = 'ramadhani.pratama';
- $apinya = curl('https://www.instagram.com/'.$username.'/?__a=1');
- $hpr = json_decode($apinya,1);
- if($hpr['graphql']['user']['is_private'] == "1"){
- $priv = 'Yes';
- }else{
- $priv = 'No';
- }
- $id = $hpr['graphql']['user']['id'];
- $username = $hpr['graphql']['user']['username'];
- $name = $hpr['graphql']['user']['full_name'];
- $biography = $hpr['graphql']['user']['biography'];
- $folwed = $hpr['graphql']['user']['edge_followed_by']['count'];
- $folwing = $hpr['graphql']['user']['edge_follow']['count'];
- $media = $hpr['graphql']['user']['edge_owner_to_timeline_media']['count'];
- $last_update = $hpr['graphql']['user']['edge_owner_to_timeline_media']['edges'][0]['node']['id'].'_'.$hpr['graphql']['user']['edge_owner_to_timeline_media']['edges'][0]['node']['owner']['id'];
- $pic = $hpr['graphql']['user']['profile_pic_url_hd'];
- $pic = explode("vp", $pic);
- $post_id = $hpr['graphql']['user']['edge_owner_to_timeline_media']['edges'][0]['node']['shortcode'];
- print ' <img class="img-circle" src="https://scontent-sit4-1.cdninstagram.com/vp'.$pic[1].'" alt="'.$hpr['graphql']['user']['full_name'].'"><br>';
- print 'ID : '.$id.'<br>';
- print 'Username : '.$username.'<br>';
- print 'Private : '.$priv.'<br>';
- print 'Name : '.$name.'<br>';
- print 'Biography : '.$biography.'<br>';
- print 'Followers : '.$folwed.'<br>';
- print 'Following : '.$folwing.'<br>';
- print 'Media : '.$media.'<br>';
- print 'Last Update : '.$last_update.'<br>';
- print 'Url Post : https://www.instagram.com/p/'.$post_id.'<br>';
- //print '<pre>'.print_r($hpr,1).'</pre>';
- function curl($url, $data=null) {
- $c = curl_init();
- curl_setopt($c, CURLOPT_URL, $url);
- if($data != null){
- curl_setopt($c, CURLOPT_POST, true);
- curl_setopt($c, CURLOPT_POSTFIELDS, $data);
- }
- curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($c);
- curl_close($c);
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement