Created
August 22, 2011 15:53
-
-
Save strackoverflow/1162731 to your computer and use it in GitHub Desktop.
Instagram Thumbnail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is now available via the official instagram api. */ | |
<?php | |
$url = $_GET['u']; | |
$r = file_get_contents($url); | |
$searchStr = 'meta property="og:image" content="'; | |
$pos = strpos($r, $searchStr); | |
$s = substr($r, $pos + strlen($searchStr)); | |
$img = substr($s, 0, strpos($s,'"')); | |
header('Location: '.$img); | |
exit; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment