Skip to content

Instantly share code, notes, and snippets.

@mgng
Created April 10, 2014 00:25
Show Gist options
  • Save mgng/10332927 to your computer and use it in GitHub Desktop.
Save mgng/10332927 to your computer and use it in GitHub Desktop.
instagrss_sample.php
<?php
$user_id = "parishilton";
$json = json_decode( file_get_contents( "http://instagram.com/{$user_id}/media" ) );
$results = array();
foreach( $json->items as $item ) {
$results[] = array(
"link" => $item->link,
"created_time" => $item->created_time,
"thumbnail_url" => $item->images->thumbnail->url,
"caption" => isset( $item->caption->text ) ? $item->caption->text : '',
"username" => $item->user->username,
"full_name" => $item->user->full_name,
);
}
print_r( $results );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment