Not long ago Flickr added two more options for published photos choosing creative commons licenses, both CC0 and a Public Domain.

This is a good thing, even if to me it adds more confusion as to which Public Domain license (both are PD licenses with differences perhaps requiring close readings with a lawyer) one might choose. It seemed like a good idea this morning to update my Flickr CC Attribution Helper tool.

A nifty side effect of the way I built it is that no one needs to create a new bookmarklet to get these features, is they are incorporated into the pages posted on github that do the work- you get now more license sniffing features and some new format options.

I started by going to review the kinds of licenses the flickr API provides for photos, and noted that they have not updated for these new options (they are values of 9 and 10). While there, I spotted a few more license varieties I was not dealing with:

  • (7) No Copyright Restrictions – these are used in the Flickr Commons the photos institutions have added to flickr under essentially a copyright free license. I am not sure if these images come up in flickr search tools I prefer like Compfight or even Google Image searches (who knows how they filter and parse results).
  • (8( United States Government Work – By law images created by the government are implicitly free of copyright

These are now recognized by The Helper (note the captions)

Carter Buton Album Loan_00007
No Copyright Restriction (The Commons) flickr photo shared by San Diego Air & Space Museum Archives

I am not quite sure how to get to the US Government photos, the only way I could find them was via the API interface searching on photos with a license code of “8” — I am not quite sure to label them as PD, but thats my best guess.

IMG_1049
Public Domain United States Government Work ( PD ) flickr photo shared by ENERGY.GOV

And an example using CC0

Maakfestival
Public Domain Dedication Creative Commons licensed ( CC0 ) flickr photo shared by FryskLab

and the Other Public Domain (“Work” or CC Mark 1?)

150410-N-PN185-1
Public Domain Work Mark 1.0 Creative Commons licensed flickr photo shared by United States Navy Band

I also realized in looking at my code was that while I was before listing the listen in the HTML attribution text, I should make the license name link to the license and the “flickr photo” link to the source. I may need to think of a way to split the hypertext because its not clear that there are two links– here is a before and after comparison for the WordPress Caption version (thanks Mom for the photo pose)

new-attribution-links

A few other bits and bobs- it may not bee seen, but I have a series of status messages that switch every half second until the flickr API work does it stuff, it should give some sense that things are in motion if the connection is slow. This was more of a “Can Alan Figure it Out” thing, but involves setting up a function called by a timer:


// set up a time to change the status message
var waiting_msg = setInterval(function () { ChangeStatusMessage() }, 500);
	
// display a random mesasge to let 'em know wheels are spinning
function ChangeStatusMessage() {
	var funnymessages = [
   'Greasing the tubes for transmission', 
   'Feeding the squirrels who spin the turbines', 
   'Checking the weather for stormy clouds', 
   'Spreading smooth peanut butter', 
   'Wondering about the meaning of life', 
   'Knocking on the doors of yahoo saying please give us some api data', 
   'Crosswiring the figwitz circuit', 
   'Gazing up at the sky', 
   'Getting the lovely stuff', 
   'Sautéing onions and garlic in butter' ];
			
	$('#attribution').text( funnymessages[Math.floor(Math.random()*funnymessages.length)] + '...');
}

Called in my script it generates a call to this function every half second (probably too quick) and calls the ChangeStatusMessage function to pick a message randomly from an array and update the div where the status is displayed.

I also call this function just inside by jQuery $(document).ready code so the thing starts with a random message. Of course you have to turn off the timer, otherwise it just keeps going, so once I get all of the flickr attribution stuff ready, I cancel the timer function:

// stop the random status messages!
clearInterval(waiting_msg);

And all of this started this morning from an email from a user who told me that my tool was not working because the attribution never appeared. I tested on the same image and everything worked. But the last thing you want to tell someone who reports a bug is “It worked for me” which gives them nothing to help them understand the issue.

So I wrote “It worked” with a screen capture, but also added my own experience that sometimes the flickr api does not respond or is offline. So I figured out a way that if the variable that holds the attribution is not changed in 10 seconds (assuming that should be long enough to get a response) it pops an alert message.

This is done with a similar function:

// placeholder for attribution string
var attrib_str = '';
		
// Create an alert if we have not generated a result
setTimeout("if (attrib_str == '') alert('Ouch, we seem to not be making contact with the flickr API, it might be taking a nap. It may need more time, or perhaps try later.')", 10000);

The script still chugs along but at least it offers a possible reason why you are not getting any attribution (this would happen as well if you lost your internet connection). My wording on the license options my need polish too, if anyone has suggestions, they are generated via these functions:

		// Now includes flickr commons, US GOVT work, and new PD licenses
		var licenses = new Array( "", "BY-NC-SA", "BY-NC", "BY-NC-ND", "BY", "BY-SA", "BY-ND", "", "PD", "CC0", "PD" );
		
		function get_license_text( thelicense ) {
			switch( thelicense ) {
				case "7":
					return 'No copyright restriction (The Commons)';
					break;
				case "8":
					return 'United States Government Work ( PD )';
					break;
				default:
					return 'Creative Commons licensed (' + licenses[thelicense] + ')';
			}
		}
	
		function get_license_html( thelicense ) {
			switch( thelicense ) {
				case "7":
					return '<a href="http://flickr.com/commons/usage/">No Copyright Restriction (The Commons)</a>';
					break;
				case "8":
					return '<a href="http://www.usa.gov/copyright.shtml">Public Domain United States Government Work ( PD )</a>';
					break;
				case "9":
					return '<a href="https://creativecommons.org/publicdomain/zero/1.0/">Public Domain Dedication Creative Commons licensed ( CC0 )</a>';
					break;
				case "10":
					return '<a href="https://creativecommons.org/publicdomain/mark/1.0/">Public Domain Work Mark 1.0 Creative Commons licensed</a>';
					break;

				default:
					cc_lic = licenses[thelicense];
					return '<a href="http://creativecommons.org/licenses/' + cc_lic.toLowerCase()  + '/2.0/">Creative Commons licensed ( ' + cc_lic +' )</a>';
			}
		}

See the full code on the basic HTML attribution and the WordPress variant.

If you want a different kind of format on the output, then you can fork the code and submit a new tool page (as John Johnston did for his Stamper)

So that’s what’s new with the Flickr CC Attribution Helper, see more on its github home


Top / featured image credit: Creative Commons licensed (CC0) flickr photo by U.S. Embassy Montevideo: http://flickr.com/photos/usembassy_montevideo/4425228640

The post "Flickr CC Attribution Tool Is That Much More Fun" was originally yanked out of the teeth of a rabid chicken at CogDogBlog (http://cogdogblog.com/2015/04/flickr-cc-attribution-tool-more-fun/) on April 12, 2015.

4 Comments

  • Maha Bali

    Nice error message about API taking a nap :) i love cute error messages coz u need sthg to laugh about when things go wrong :)

    Thanks for updating it. For the recor, i could see the two separate links clearly. Maybe coz i read an earlier post where you talked about separating them. I need to go back to using your bookmarklet :) i used it a few times then forgot. I should let my students know about it, too, so they can attribute more easily (usually I forget to teach them about this for the undergrads)

  • Ken Bauer

    Thanks for updating this and giving us all of the fun details. I learned a few things today about the licensing options available at Flickr.

    Maybe the text would be better done something like:
    flickr photo shared by cogdogblog under a Creative Commons (BY-SA) license

    Then “shared by” and “under a” are both plain text with no links to separate the three links. Or is that just too much text. #hmm

Leave a Comment

All fields are required. Your email address will not be published.