If you ever wanted to pull random flickr images using their API all you need is the following.
<?php
$randpage = rand(1,2);
$userID = “[YOUR USER ID]“;
$apiKey = “[YOUR API KEY]“;
$photosAsXMLURL = “http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key={$apiKey}&user_id={$userID}&page={$randpage}”;
$xml = simplexml_load_file($photosAsXMLURL);
$rd = rand(0,100);
$ad = $xml->photos->photo[$rd];
$imageURL = “http://farm”.$ad['farm'].”.static.flickr.com/”.$ad['server'].”/”.$ad['id'].”_”.$ad['secret'].”.jpg”;
$linkURL = “http://www.flickr.com/photos/{$userID}/”.$ad['id'];
echo “<div id=’randomImageFromFlickr’><a href=’$linkURL’target=’_new’><img border=’0′ src=’$imageURL’alt=’{$ad['title']}’/></a></div>”;
?>
Your welcome

