Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. $data = @file_get_contents("https://www.instagram.com/".$_GET['username']."/?__a=1");
  3. if($data[0] == "{"){
  4.  
  5. $json_data = json_decode($data);
  6.  
  7. $user_id = $json_data->user->id;
  8. $following_count = $json_data->user->follows->count;
  9. $followers_count = $json_data->user->followed_by->count;
  10. $bio = $json_data->user->biography == "" ? "empty" : $json_data->user->biography;
  11. $is_private = $json_data->user->is_private == true ? 1 : 0;
  12. $media_count = $json_data->user->media->count;
  13.  
  14. echo $data;
  15. }else{
  16. echo '{"user": {"username": "notfound", "follows": {"count": 0}, "followed_by": {"count": 0}, "profile_pic_url": "https://instagram.fsvg1-1.fna.fbcdn.net/t51.2885-19/11906329_960233084022564_1448528159_a.jpg", "is_private": true, "full_name": null, "media": {"count": 0}}}';
  17. }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement