// ==UserScript== // @name Remove Digg Bar // @namespace http://the-blair.com/greasemonkey // @description Eliminates all of the Digg style short URLs, thereby eliminating the Digg bar. // @include http://digg.com/* // ==/UserScript== function gen_decode_url(shorturl) { return 'http://services.digg.com/url/short' + shorturl + '?appkey=http://the-blair.com/greasemonkey&type=json'; } function replace_link(link) { var request = gen_decode_url(link.pathname); GM_xmlhttpRequest({method: "GET", url:request, onload:function(response) { response = eval('(' + response.responseText + ')'); link.setAttribute('href', response.shorturls[0].link); }}); } var regex = /d1[0-9a-zA-Z]{4}/ var links = document.getElementsByTagName('a'); for(i = 0; i < links.length; i++) { var link = links[i]; if(!link.hasAttribute('href')) continue; if(!regex.test(link.pathname)) continue; replace_link(link); }