Flickr CC Attribution Helper

By CogDog Last update May 25, 2013 — Installed 3,960 times.

Include type of CC licensen in the script

in
Subscribe to Include type of CC licensen in the script 3 posts, 2 voices



Seccubus User
FirefoxWindows

Hi,

I added the following lines to add the license type to the attribution:


var cc_lic = "";
var attr = document.evaluate("//img[@class='f-sprite fs-cc_icon_attribution_small']",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
null).singleNodeValue;
var nocomm = document.evaluate("//img[@class='f-sprite fs-cc_icon_noncomm_small']",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
null).singleNodeValue;
var noderr = document.evaluate("//img[@class='f-sprite fs-cc_icon_noderivs_small']",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
null).singleNodeValue;
var sa = document.evaluate("//img[@class='f-sprite fs-cc_icon_sharealike_small']",
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,
null).singleNodeValue;
if (attr) {
cc_lic = cc_lic + "by ";
}
if (nocomm) {
cc_lic = cc_lic + "nc ";
}
if (noderr) {
cc_lic = cc_lic + "nd";
} else if (sa) {
cc_lic = cc_lic + "sa";
}

I then included the cc_lic in the attribution line.

 
CogDog Script's Author
ChromeMacintosh

Thanks for the suggestion! I tried once before but stumbled a bit on the right XPath code! I'll roll it into the script shortly.

 
CogDog Script's Author
ChromeMacintosh

I just updated this script to a new version that includes the license type in output. Thanks!