Skip to content

Instantly share code, notes, and snippets.

@fleeting
Created January 10, 2010 04:19
Show Gist options
  • Save fleeting/273329 to your computer and use it in GitHub Desktop.
Save fleeting/273329 to your computer and use it in GitHub Desktop.
$flickrAPI = 'http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=69f31081cc7123755564c66ae0af159c&user_id=32609765@N00&per_page=5&format=php_serial';
$rsp = file_get_contents($flickrAPI);
$rsp_obj = unserialize($rsp);
if ($rsp_obj['stat'] == 'ok'){
foreach ($rsp_obj['photos']['photo'] as $flickrPhoto) {
echo '<a href="http://www.flickr.com/photos/'.$flickrPhoto['owner'].'/'.$flickrPhoto['id'].'">'.$flickrPhoto['title'].'</a><br />';
echo '<img src=http://farm'.$flickrPhoto['farm'].'.static.flickr.com/'.$flickrPhoto['server'].'/'.$flickrPhoto['id'].'_'.$flickrPhoto['secret'].'_s.jpg"><br /><br />';
}
}else{
echo "Call failed!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment