Gaia Online Thread Feed

By Jarett Last update Jan 17, 2008 — Installed 1,424 times. Daily Installs: 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 4, 0, 0, 5, 7, 0, 0, 2, 0, 0, 0
// ==UserScript==
// @name           Gaia Online Thread Feed
// @namespace      http://eveningnewbs.googlepages.com
// @description    Embeds an RSS feed for Gaia threads.
// @include        http://gaiaonline.com/forum/*
// @include        http://www.gaiaonline.com/forum/*
// ==/UserScript==

// Begin Script Update Checker code
var version_scriptURL = "http://userscripts.org/scripts/source/18945.user.js"; // Change this URL to point to a permanent copy of your own script.
var version_timestamp = 1200458024546; // Used to differentiate one version of the script from an older one. Use the Date.getTime() function to get a value for this.
if(parseInt(GM_getValue("lastUpdate","0"))+86400000<=(new Date().getTime())){GM_xmlhttpRequest({method:"GET",url:version_scriptURL+"?"+new Date().getTime(),headers:{'Cache-Control':'no-cache'},onload:function(xhrResponse){GM_setValue("lastUpdate",new Date().getTime()+"");if(parseInt(/version_timestamp\s*=\s*([0-9]+)/.exec(xhrResponse.responseText)[1])>version_timestamp){if(confirm("There is an update available for the Greasemonkey script \""+xhrResponse.responseText.split("@name")[1].split("\n")[0].replace(/^\s+|\s+$/g,"")+".\"\nWould you like to go to the install page now?")){GM_openInTab(version_scriptURL);}}}});}
// End Script Update Checker code

thread = document.URL;
t1 = thread.indexOf("/t.");
t2 = thread.indexOf("?t=");
if ((t1 != -1) || (t2 != -1))
{
	if (t1 != -1)
		t = parseInt(thread.substr(t1 + 3)) + "";
	else
		t = parseInt(thread.substr(t2 + 3)) + "";
	if (t > 0)
	{
		rssLink = unsafeWindow.document.createElement("div");
		rssLink.innerHTML = '<div style="background-color:#ffc; padding:6px; top:5px; left:6px; border:solid 1px #cc9; float:left;"><a title = "Thread Updates via RSS" href = "http://jarett.nfshost.com/gaiarss.php?t=' + t + '"><img src = "chrome://browser/skin/page-livemarks.png" /></a></div>';
		gigya = unsafeWindow.document.getElementById("gigya");
		gigya.parentNode.insertBefore(rssLink, gigya.nextSibling);
	}
}