Skip to content

Instantly share code, notes, and snippets.

@robdehaven
robdehaven / flickr-list-photosets
Created August 27, 2011 14:41
Flickr List Photosets (coreylib)
<?php require_once('coreylib.php'); ?>
<?php if ($photos = coreylib('http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=[ENTER-API-KEY]&user_id=[ENTER-USER-ID]&format=rest')) { ?>
<ul>
<?php foreach($photos->get('photosets/photoset') as $photoset) { ?>
<a href="http://www.flickr.com/photos/[ENTER-USERNAME]/sets/<?php echo $photoset['id'] ?>">
<img src="http://farm<?php echo $photoset['farm'] ?>.static.flickr.com/<?php echo $photoset['server'] ?>/<?php echo $photoset['primary'] ?>_<?php echo $photoset['secret'] ?>_s.jpg" /><br />
<?php echo $photoset->get('title') ?></a>
</a>
<?php } ?>
</ul>