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