femaledub

Custom Made Instagram API

Nov 19th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.03 KB | None | 0 0
  1. <?php
  2. /*
  3. Coded by Streamah
  4. https://hackforums.net/member.php?action=profile&uid=3105131
  5. Released on 11/19/2016
  6.  
  7. ---
  8.  
  9. Username Functions (api.php?command=bio&username=echo123),
  10. [+] bio
  11. [+] name
  12. [+] profile_picture
  13.  
  14. Picture Functions (api.php?command=current_likes&link=http://instagram.com/p/iu4g3D,
  15. [+] current_likes
  16. [+] media_id
  17. [+] thumbnail
  18. [+] userid
  19. [+] username
  20.  
  21. ---
  22.  
  23. If you need any help, PM me on HF.
  24. */
  25.  
  26. //Settings
  27. error_reporting(0);
  28. $link     = $_GET['link'];
  29. $command  = $_GET['command'];
  30. $username = $_GET['username'];
  31.  
  32. if ($command == null) {
  33.     echo 'You must enter a command.';
  34. }
  35.  
  36. //Grabs bio from username
  37. if ($command == "bio") {
  38.     if ($username == null) {
  39.         echo 'You must enter a username';
  40.     } else {
  41.         $content     = file_get_contents('http://instagram.com/' . $username . '');
  42.         $first_step  = explode('<meta property="og:description" content="', $content);
  43.         $second_step = explode('"', $first_step[1]);
  44.         echo $second_step[0];
  45.        
  46.     }
  47. }
  48.  
  49. //Grabs name from username
  50. if ($command == "name") {
  51.     if ($username == null) {
  52.         echo 'You must enter a username';
  53.     } else {
  54.         $content     = file_get_contents('http://instagram.com/' . $username . '');
  55.         $first_step  = explode('<meta property="og:title" content="', $content);
  56.         $second_step = explode('(', $first_step[1]);
  57.         echo $second_step[0];
  58.     }
  59. }
  60.  
  61. //Grabs profile picture from username
  62. if ($command == "profile_picture") {
  63.     if ($username == null) {
  64.         echo 'You must enter a username';
  65.     } else {
  66.         $content     = file_get_contents('http://instagram.com/' . $username . '');
  67.         $first_step  = explode('<meta property="og:image" content="', $content);
  68.         $second_step = explode('"', $first_step[1]);
  69.         echo $second_step[0];
  70.     }
  71. }
  72.  
  73. //Grabs the amount of likes from a picture
  74. if ($command == "current_likes") {
  75.     if ($link == null) {
  76.         echo 'You must enter the link';
  77.     } else {
  78.         $content     = file_get_contents($link);
  79.         $first_step  = explode('<meta content="See this Instagram photo by ', $content);
  80.         $second_step = explode('"', $first_step[1]);
  81.         echo $second_step[0];
  82.        
  83.     }
  84. }
  85.  
  86. //Grabs the media_id from a picture
  87. if ($command == "media_id") {
  88.     if ($link == null) {
  89.         echo 'You must enter the link';
  90.     } else {
  91.         $content     = file_get_contents($link);
  92.         $first_step  = explode('<meta property="al:ios:url" content="instagram://media?id=', $content);
  93.         $second_step = explode('"', $first_step[1]);
  94.         echo $second_step[0];
  95.        
  96.         echo '_';
  97.        
  98.         $first_step  = explode('<meta property="instapp:owner_user_id" content="', $content);
  99.         $second_step = explode('"', $first_step[1]);
  100.         echo $second_step[0];
  101.        
  102.     }
  103. }
  104.  
  105. //Grabs the original thumbnail url from a picture
  106. if ($command == "thumbnail") {
  107.     if ($link == null) {
  108.         echo 'You must enter the link';
  109.     } else {
  110.         $content     = file_get_contents($link);
  111.         $first_step  = explode('<meta property="og:image" content="', $content);
  112.         $second_step = explode('"', $first_step[1]);
  113.         echo $second_step[0];
  114.     }
  115. }
  116.  
  117. //Grabs the userid of the user from a picture
  118. if ($command == "userid") {
  119.     if ($link == null) {
  120.         echo 'You must enter the link';
  121.     } else {
  122.         $content     = file_get_contents($link);
  123.         $first_step  = explode('<meta property="instapp:owner_user_id" content="', $content);
  124.         $second_step = explode('"', $first_step[1]);
  125.         echo $second_step[0];
  126.        
  127.     }
  128. }
  129.  
  130. //Grabs the username of the user from a picture
  131. if ($command == "username") {
  132.     if ($link == null) {
  133.         echo 'You must enter the link';
  134.     } else {
  135.         $content     = file_get_contents($link);
  136.         $first_step  = explode('<meta content="See this Instagram photo by ', $content);
  137.         $second_step = explode(' •', $first_step[1]);
  138.         echo $second_step[0];
  139.     }
  140. }
  141. ?>
Advertisement
Add Comment
Please, Sign In to add comment