Flickr bookmarklets
I originally posted last January about a bookmarklet I threw together to generate the appropriate code for vBulletin that will show and link to an image on Flickr. That code recently broke, with the introduction of a farm ID in the static image URL. This is an updated version of that which uses the old (non-farm) URL. Images uploaded after that change was implemented on Flickr’s servers will get redirected, but should still work. Without further ado, here are the new bookmarklets!
Flickr to vbCode
Additionally, I’ve got a Markdown variation that I hadn’t mentioned:
Flickr to Markdown
The Markdown one is useful for WordPress blogs that use Markdown (like MotoringFile).
For future reference, the following is the code that does the magic; all you need to do is URL-escape the code and stick it into a “javascript:” URL.
// vbCode
var img = global_photos[page_photo_id];
var imgLoc = <em>photo</em>root.replace("http://farm.", "http://") +
img.server + "/" + page_photo_id + "_" + img.secret + '.jpg';
var msg = "[url="+ document.location + "][img]" + imgLoc + "[/img][/url]";
prompt("vbCode", msg);
// Markdown
var img = global_photos[page_photo_id];
var imgLoc = <em>photo</em>root.replace("http://farm.", "http://") +
img.server + "/" + page_photo_id + "_" + img.secret + '.jpg';
var mdImg = '';
var msg = '[' + mdImg + '](' + document.location + ')';
prompt("Markdown code", msg);