Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <title>Instagram API</title>
- <pre>
- +------------------------------------+
- + Open Source. +
- +------------------------------------+
- + Public Access Token: <b>s37gViTXrc</b> +
- +------------------------------------+
- + Guide +
- +------------------------------------+
- + <b>Bold</b> = Input a picture by the user +
- + <i>Italic</i> = Input username only +
- +------------------------------------+
- + Functions: +
- + • <b>userid</b> +
- + • <b>username</b> +
- + • <b>media_id</b> +
- + • <b>thumbnail</b> +
- + • <b>java</b> +
- +------------------------------------+
- + • <i>username</i> +
- + • <i>bio</i> +
- + • <i>profile_picture</i> +
- +------------------------------------+
- + ?<b>access_token</b>&<b>function</b>=&<b>input</b>= +
- +------------------------------------+
- </pre>
- <?php
- //Don't Touch
- error_reporting(0);
- $access_token = $_GET['access_token']; //API Key
- $function = $_GET['function']; //Function(s)
- $input = $_GET['input']; //Input
- //Checks to see if access token is blank
- if ($access_token == null) {
- echo '<b>You must enter your access token</b>';
- die();
- }
- //Checks to see if access token matches
- if ($access_token == "s37gViTXrc") {
- if($function == null)
- {
- echo '<b>You must enter a function</b>';
- die();
- }
- if ($function == "userid") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="instapp:owner_user_id" content="', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Username
- if ($function == "username") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta content="See this Instagram photo by ', $content);
- $second_step = explode(' •', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Media ID
- if ($function == "media_id") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="al:ios:url" content="instagram://media?id=', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- echo '_';
- $first_step = explode('<meta property="instapp:owner_user_id" content="', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Thumbnail
- if ($function == "thumbnail") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="og:image" content="', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Java
- if ($function == "java") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<script type="text/javascript">window._sharedData =', $content);
- $second_step = explode('<', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Name
- if ($function == "name") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="og:title" content="', $content);
- $second_step = explode('(', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Bio
- if ($function == "bio") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="og:description" content="', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- }
- }
- //Profile Pic
- if ($function == "profile_pic") {
- $content = file_get_contents($input);
- if ($input == null) {
- echo '<b>No input</b>';
- } else {
- $first_step = explode('<meta property="og:image" content="', $content);
- $second_step = explode('"', $first_step[1]);
- echo $second_step[0];
- }
- }
- } else {
- echo '<b>Invalid Access Token</b>';
- }
- ?>
Add Comment
Please, Sign In to add comment