Flickr: Link Your Photos Back To Your Blog
I post photos to Flickr from time to time, and then write blog articles about the photos. The blog articles get written days, weeks, sometimes months in advance of when they're scheduled to appear on my blog a which makes it a tad difficult to add a link from a photo to all of the blog articles that mention it.
So a couple of weekends ago I knocked up a very crude script that uses the Flickr API (via phpFlickr) to work through all of the published blog posts and make sure each of my Flickr photos has links back to each blog post that mention it. I'm posting it here in the public domain. Hopefully someone will find it a useful starting point to do something similar for their own blog.
$flickrApiKey = a';
$flickrSecret = a';
$flickrToken A= a';
$f = new phpFlickr($flickrApiKey, $flickrSecret);
$f-enableCache(afs', a/tmp', 3600);
/', $rawHtml, $matches);
$latestPost = $matches;
$nextPost = $url . a?p=' . $latestPost;
function updatePhotos($photoIndex, $flickrPhotos,
Truncated by Planet PHP, read more at the original (another 22896 bytes)