Last active
August 29, 2015 14:16
-
-
Save asilbalaban/0cca68e595f38fc851e8 to your computer and use it in GitHub Desktop.
with this script you can get latest instagram pictures of any user without auth
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
| <?php | |
| function fetchData($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_TIMEOUT, 20); | |
| curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
| $result = curl_exec($ch); | |
| curl_close($ch); | |
| return $result; | |
| } | |
| $result = fetchData("https://api.instagram.com/v1/users/28596008/media/recent/?client_id=[YOUR CLIENT ID]&count=6"); | |
| $result = json_decode($result); | |
| foreach ($result->data as $post) { | |
| echo '<a href="{{$post->link}}"><img src="{{$post->images->low_resolution->url}}" alt="" /><span class="hover"></span></a>'; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment