There are 11 previous versions of this script.
// ==UserScript==
// @version 1.1.1
// @name Gigapedia Linkify
// @date 2009-05-19
// @namespace http://userscripts.org/scripts/show/40456
// @description Modifies the outgoing links of books to that of download page of that book. Modifies only the URLs pointing to a gigapedia.com domain. Can recognize such links across the web, across all the pages.
// @include *
// ==/UserScript==
/*
Works gloablly accross all the pages. Affects only the URL within gigapedia.com.
Whenever it encounters any link to Gigapedia item pages, it modifies the corresponding
URL to point directly to the download pages of that item, without going to the usual
gigapedia default of first showing the user comments.
*/
/*
Created by Niraj Prasad (np1@nirajp.8k.com)
http://niraxar.googlepages.com
Version history :
0.0.1 :: Jan 14th 2009
0.0.2 :: Jan 16th 2009 [modified such that comments page can be accessed while inside gigapedia.com domain]
0.0.3 :: Jan 25th 2009 [still more improvements inside gigapedia.com domain]
1.0.0 :: Jan 28th 2009 [cleaned up the code, removed beta tag, changed namespace to official userscripts description]
1.1 :: May 15th 2009 [modified the script so that clicking on Gigapedia links from Google Reader works as desired]
*/
var currpage = window.location.href;
var referr = document.referrer;
var allurls = document.getElementsByTagName('A');
var Max = allurls.length;
if(currpage.search(/gigapedia\.com\/items/) == -1)
for(var i = 0; i < Max; i++)
{
allurls[i].href = allurls[i].href.replace(/gigapedia\.com\/items\//, 'gigapedia\.com\/items:links?id=');
};
if(referr.search(/google\.com\/reader/) != -1)
{
if(window.location.href.search(/gigapedia/) != -1)
window.location.href = window.location.href.replace(/items\//, 'items:links?id=');
}
