Flickr Original Link

Made by Skyfall. Show link to download biggest image on Flickr

As of 2014-05-18. See the latest version.

// ==UserScript==
// @name        Flickr Original Link
// @namespace   https://greasyfork.org/users/1474-freakingprime
// @include     http://*flickr.com/photos/*
// @include     https://*flickr.com/photos/*
// @version		1.6
// @grant 		none
// @description Made by Skyfall. Show link to download biggest image on Flickr
// ==/UserScript==
var pageData = document.documentElement.innerHTML;
var size = pageData.match(/"sizes":{(?:.+?)}}/);
var link = "";
var url = "";
var num = "";
if (size)
{
	url = size[0].match(/.*"url":"([^"]+)"/);
	num = size[0].match(/.*"width":(\d+),"height":(\d+),/);
//:685,"height":1024,"url":"\/\/farm8.staticflickr.com\/7022\/6470565807_691ea9d98f_b.jpg"
}
if (url) {
	link = url[1];
	link = link.replace(/\\\//g, "/");
	link = "http:" + link;
	var div = document.getElementsByClassName("sidebar-panel-fixed")[0];
	var button = document.createElement("div");
	var download = document.createElement("a");
	button.appendChild(download);
	download.appendChild(document.createTextNode("DOWNLOAD BIG "+num[1]+" x "+num[2]));
	download.href = link;
	download.style.display = "block";
	button.style = "padding:10px 1px; background-color:blue;text-align:center;color:red;font-weight:bold;";
	div.appendChild(button);
}