AJAX Twitter Refresh

By SourNote Last update Sep 26, 2008 — Installed 771 times. Daily Installs: 0, 0, 1, 3, 0, 0, 0, 0, 1, 0, 1, 0, 2, 3, 0, 2, 1, 0, 1, 1, 2, 0, 1, 1, 3, 0, 0, 0, 1, 1, 1, 0

There are 2 previous versions of this script.

// ==UserScript==
// @name           AJAX Twitter Refresh
// @namespace      http://sournote.org/scripts
// @description    Refreshes twitter every so often
// @include        http*://twitter.com/*
// ==/UserScript==

// Set this variable to define how many minutes you want between refreshes
window.TWITTERREFRESHMINUTES = 5;


window.twitterRefreshFunction = function()
{
	var tabID="",x;

	x = unsafeWindow.location;

	if( x == "http://twitter.com/home" || x == "https://twitter.com/home" )
	{
		tabID = "home_tab";
	}
	else if( x == "http://twitter.com/replies" || x == "https://twitter.com/replies" )
	{
		tabID = "replies_tab";
	}
	else if( x == "http://twitter.com/direct_messages" || x == "https://twitter.com/direct_messages" )
	{
		tabID = "direct_messages_tab";
	}

	if( tabID != "" )
		unsafeWindow.document.getElementById(tabID).onclick();
};


(function(){window.twitterRefreshTimer = setInterval(window.twitterRefreshFunction,window.TWITTERREFRESHMINUTES*60*1000);})();