- Jun 18, 2009
- 4
- 0
- 0
Hi,
I wrote a little greasemonkey scirpt to remove spoilers from race results section:
To use it, install greasemonkey. Then, go to cyclingnews homepage, go to your menu 'tools - greasemonkey - new user script', fill in & submit form, paste the code above into your text file and save it. Then reload cycling news.
Any problem let me know!
NB. the script will probably break eventually since the site developers will almost certainly change how stuff is displayed eventually. But for now...
I wrote a little greasemonkey scirpt to remove spoilers from race results section:
// ==UserScript==
// @name despoil cyn
// @namespace http://www.random-productions.co.uk
// @description Removes spoiler headlines from Cycling News
// @include http://www.cyclingnews.com/
// ==/UserScript==
var allDivs, thisDiv;
allDivs = document.evaluate(
"//ul[@class='articles']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i = 0; i < allDivs.snapshotLength; i++)
{
thisDiv = allDivs.snapshotItem(i);
var as = thisDiv.getElementsByTagName('a');
for (var j=0;j<as.length; j++)
{
if (as[j].href.indexOf('/stages/') != -1)
{
var pos = as[j].innerHTML.indexOf('Stage');
if (pos == 0)
as[j].innerHTML = as[j].innerHTML.substring(0,10);
}
}
}
To use it, install greasemonkey. Then, go to cyclingnews homepage, go to your menu 'tools - greasemonkey - new user script', fill in & submit form, paste the code above into your text file and save it. Then reload cycling news.
Any problem let me know!
NB. the script will probably break eventually since the site developers will almost certainly change how stuff is displayed eventually. But for now...