This morning I drove down a new coding rode- I’ve never done a Greasemonkey script, so with some help poking around ones I have and Dive into Greasemonkey — here is my crude Flickr CC Attribution Helper.
What is does is adds a box on the right side of flickr photo pages — only for photos with a Creative Commons License — some HTML you can copy and paste for a blog post.
I found an existing script Flickr Photo Link but that was meant to grab the entire image URL (mine is meant for a caption assuming you have already inserted an image into a blog post or web page). Also, that 3 year old script did not even work because it was not parsing correctly for the user name the way it does the XPath search on the <b> tag (looks like flick added a
foaf attribute), but also, I did not like the way it stuck the code to copy in the comment text area which would get in the way of making comments.
But that script was a good start, and with a little bit of trial an error, I have the HTML being inserted in a text area on the sidebar. I have not yet mastered how to exactly place it using the flickr pages DOm structure, so it is hanging in the Tags content part. If someone better at GreaseMonkeying can help me move it say below the license area, I’d be a tali wagging coder.
And this is really set up for the way I write my photo links. I don;t just insert the image link from flickr; I download the image, upload to my blog, and then add after something like for say, this dreamy I’d like to be there now image:
<a title="Outlet on the Sound"
cc licensed flickr photo</a> shared by
or as displayed:
So in some sense, this is hardwired to the way I compose my attribution, although, it does not take too much to edit the script. I may add as a default the embed code for the image itself from flickr, since that is the way people likely use images anyhow (I like to have them on my own server).
This is really just a crude first cut at this script, more to see if it is of use (and heck, I will use it if no one else does). Give it a try and let me know what it needs http://userscripts.org/scripts/show/49395
UPDATE: With help form Patrick, the 0.2 version of the script now is placed better in the flickr sidebar. I added to the HTML you get the link to display the image and link to the source photo, and added script so when you click in the field, the text is automatically selected for quick copying
The post "Flickr CC Attribution Helper Greasemonkey Script" was originally slapped on the butt by a cigar smoking doctor yelling "It's a post!" at CogDogBlog (http://cogdogblog.com/2009/05/flickr-cc-attribution-helper/) on May 17, 2009.