Flickr Original Link

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

As of 2014-06-25. See the latest version.

// ==UserScript==
// @name        Flickr Original Link
// @namespace   https://greasyfork.org/users/1474-freakingprime
// @include     http://www.flickr.com/photos/*
// @include     https://www.flickr.com/photos/*
// @version		2.1
// @grant 		none
// @require 	http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @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 = "http:" + link.replace(/\\\//g, "/");
	$(window).load(function() {
		var button = $("div.download a");
		button.attr('href',link);
		button.attr('title',"Size: "+num[1]+" x "+num[2]+" px");
	});
}