There are 2 previous versions of this script.
// ==UserScript==
// @name AllegroTools (Homepage) dla IE i FF
// @namespace http://www.allegrotoolsie.hopto.org/
// @description Kilka ulatwien w dostepie do strony http://allegrotoolsie.hopto.org // v0.20101128.0
// @include *
// ==/UserScript==
(function(){
/////////////////////////////////////////////////////////////////
var ALLEGROTOOLSIE_HOMEPAGE = "http://allegrotoolsie.hopto.org";
var SCRIPTS_PAGE = "scripts.html";
function gotoAllegrotoolsHomepage()
{
window.top.location.href = ALLEGROTOOLSIE_HOMEPAGE;
}
function checkScriptVersions()
{
GM_xmlhttpRequest({method:"GET", url:ALLEGROTOOLSIE_HOMEPAGE + "/" + SCRIPTS_PAGE, onload:function(d){processCheckScriptVersionsResponse(d)}});
}
function processCheckScriptVersionsResponse(details)
{
var result = false;
if(details)
{
var responseText = details.responseText;
if(responseText)
{
// First check for 'hopto.org' redirect...
if(responseText.match(/<frame src="(.*?)" name="redir_frame".*?>/))
{
// ...and follow the redirect if found
result = true;
GM_xmlhttpRequest({method:"GET", url:RegExp.$1, onload:function(d){processCheckScriptVersionsResponse(d)}});
}
else
{
// ...otherwise get the available scripts
var array = details.responseText.match(/\[VERSION_INFO:.*?\]/g);
if (array != null)
{
if (array.length > 0)
{
var string = "Aktualne wersje skryptow AllegroToolsIE:\n\n";
for(var i = 0; i < array.length; i++)
{
if (array[i].match(/\[VERSION_INFO:(.*?)\|(.*?)\]/))
{
string = string.concat(RegExp.$1 + " (v" + RegExp.$2 + ")\n");
}
}
result = true;
alert(string);
}
}
}
}
}
if(result == false)
{
details.responseText
}
}
function allegrotoolsHomepage()
{
GM_registerMenuCommand("Przejdz do http://allegrotoolsie.hopto.org", gotoAllegrotoolsHomepage);
GM_registerMenuCommand("Sprawdz wersje", checkScriptVersions);
}
/////////////////////////////////////////////////////////////////
// Start Allegro Tools Homepage script
/////////////////////////////////////////////////////////////////
allegrotoolsHomepage()
})();