This may be helpful to others. If you are uploading flickr photos via Perl, and you would like your caption to automatically include a link to the original photo — all it requires is this tiny snippet of code:
NOTE!!! I HAVE COME UP WITH BETTER CODE FOR THIS HERE!!! YOU SHOULD PROBABLY USE THAT INSTEAD!
my $FLICKR_PHOTOID_URL = “http://flickr.com/photo.gne?id=”;
if ($file =~ /([0-9]{10})_[0-9a-f]{10}_[a-z]/i) {
$caption .= “Originally posted at $FLICKR_PHOTOID_URL$1\n”;
}
NOTE!!! I HAVE COME UP WITH BETTER CODE FOR THIS HERE!!! YOU SHOULD PROBABLY USE THAT INSTEAD!
Note that this only works if you keep the numbers from the filename that flickr gives you when you save a picture. IE “3375260709_1eb18b2012_o.jpg”. You can of course add anything else to the filename, but the “3375260709_1eb18b2012_o” part must be in there for this to work.
Mood: full
Music: Kreator – Awakening Of The Gods
September 30, 2009 at 1:59 PM
[...] September 30, 2009 CLINT’S TIPS: Perl code to link to original photo after downloading from Flickr – version 2.0 Posted by Clint under Journal Leave a Comment When you download photos from flickr, the photo ID is actually stored in the filename, and you can use this to get back to the original photo. I decided to make any photos that are uploaded with the flickr filename automatically link to the original via perl code that I first posted here. [...]