Tag Archives: Greasemonkey

I wondered why I got a spike in traffic…

Recently, I solved a small (seriously, really small) issue with one of my favorite Greasemonkey scripts “Smilies and other tools“.

krisdecurtis' buddy icon Kris de Curtis was nice enough to point people to my site for the solution that I came up with.  On top of lending people a helping hand, he’s a good Photographer too, check out his flickr site.

😉

My first Greasemonkey Script

flickr_logo_gammaIt’s been years since I did any Javascript programing, but I had a simple problem and decided to dive into it.

Like many of the little programs I write, I had a “problem” and wanted to solve it. I wanted a convenient link on the photo page to cut and paste the short URL of FLickr Images.  Look at this URL for a nice photo my wife took:

http://www.flickr.com/photos/s_d/3665619548/

As a URL goes, not too bad, but suppose you wanted to insert the link in
Twitter or Facebook? It’s a little verbose.  Wouldn’t this be better?

http://flic.kr/p/6zVfZ3

Yep, I think so too and so does Flickr:
http://www.flickr.com/services/api/misc.urls.html#short
http://www.flickr.com/groups/api/discuss/72157616713786392/
This thread showed how to do it: http://www.flickr.com/groups/api/discuss/72157616713786392/

The FlickrBase58 function in the script was written entirely by ‘Xenocryst @ Antares Scorpii’
http://www.flickr.com/people/antares/

Other than reformating, taken verbatim from link here
http://www.flickr.com/groups/api/discuss/72157616713786392/72157620673064673/

The Original way *I* wrote it was to retrieve the HTML, Parse it for
<link rev=”canonical” type=”text/html” src=”//flic.kr/p/6zVfZ3″ >

And use that link. While fun to write, that’s the wrong way to do it so I rewrote it to use the function written by ‘Xenocryst @ Antares Scorpii’ .  When installed on Firefox running the Greasemonkey extension, it will insert a link on the page on the right side just under “Flag your photo” that says:

The Flic.kr link is: http://flic.kr/p/6zVfZ3

This will allow you to right click the URL, copy it and paste into Twitter or Facebook.

Here is the script.

NOTE: I’m pretty certain it’s harmless, but use at your own risk. It’s hardly great programming and I’m sure someone else would have done it too, if not better.

Music I’m listening to right Now:
Paralyzer ” by Finger Eleven from the “Them VS. You VS. Me” Album.

Firefox 3.5rc2 and “Flickr Comment Tools”

Flickr Comment Tools” is a great Greasemonkey script that I use everyday but under Firefox 3.5, it would not insert emoticons. Finally fixed it, It was a simple change that was driving me nuts… As I posted here:

view photostream S.D. Pro User says:

Got it.

Change this:

[javascript]
ifrm.contentDocument.execCommand(‘inserthtml’,false,'<a title="Smilies" style="background:white !important;" href="http://www.ts0.com/flickrcommenttools/"><img align="absmiddle" style="vertical-align:middle;" src="’+this.url+’" border="0"></a>’);
[/javascript]

to:

[javascript]
ifrm.contentDocument.execCommand(‘inserthtml’,false,'<a title="Smilies" style="background:white !important;" href="http://www.ts0.com/flickrcommenttools/"><img align="absmiddle" style="vertical-align:middle;" src="’+this.src+’" border="0"></a>’);
[/javascript]

Music I’m listening to now:
Nothing at the moment