fetch("http://www.flickr.com/services/rest/?method=flickr.favorites.getList&api_key=".API_KEY."&auth_token=".FULL_TOKEN."&api_sig=".$api_sig); parse_xml_results($snoopy->results); //take what we now need from $api_return because our del.icio.us call will //unset it later $photos = $api_return[0]['children'][0]['children']; //go through each photo and save if never saved to del.icio.us before foreach ($photos as $photo) { $url = sprintf("http://www.flickr.com/photos/%s/%s",$photo['attributes']['OWNER'], $photo['attributes']['ID']); $description = $photo['attributes']['TITLE']; $tags = "flickr photography autobookmarked"; //check to see if the url has already been posted do_api_call('/posts/get?',"&url=".urlencode($url)); if (!isset($api_return[0]['children'])) { do_api_call('/posts/add?',"&url=".urlencode($url)."&description=" .urlencode($description)."&tags=".urlencode($tags)); if ($api_return['status'] == 200) echo "Posted: ".$description."\n"; else echo "There was a problem posting ".$description."\n"; } else { echo $url." already posted - skipping\n"; } } ?>