Gigasize download timer remover

By laughingLoki Last update Aug 22, 2007 — Installed 3,285 times. Daily Installs: 13, 8, 9, 13, 12, 11, 14, 9, 16, 10, 19, 16, 14, 15, 12, 8, 14, 13, 14, 20, 12, 19, 15, 16, 16, 16, 11, 9, 21, 9, 9, 9
// ==UserScript==
// @name          Gigasize download timer remover
// @namespace     http://gigasize.com
// @description   (v1.00) Removes the download timer on gigasize.com and gives you a clean page with download links
// @include       http://*.gigasize.com/get.php/*
// @include       http://gigasize.com/get.php/*
// @include       http://*.gigasize.com/formdownload.php
// @include       http://*.gigasize.com/formdownload.php/*
// @include       http://gigasize.com/formdownload.php
// @include       http://gigasize.com/formdownload.php/*
// ==/UserScript==

/*******************************************************************************
functions to edit the page:
*******************************************************************************/

function hide(id)
{
    if(document.getElementById(id))
        document.getElementById(id).style.display="none";
}

function show(id)
{
    if(document.getElementById(id))
        document.getElementById(id).style.display="";
}


function replace(id, val)
{
    if(document.getElementById(id))
        document.getElementById(id).innerHTML=val;
}

function append(id, val)
{
    if(document.getElementById(id))
        document.getElementById(id).innerHTML+=val;
}

function prepend(id, val)
{
    if(document.getElementById(id))
    {
        element=document.getElementById(id);
        element.innerHTML=val+element.innerHTML;
    }
}

function hard_refresh()
{
    window.location.href=window.location.href;
}

function replace_body(content)
{
    document.getElementsByTagName("body")[0].innerHTML=content;
}

function append_body(content)
{
    document.getElementsByTagName("body")[0].innerHTML+=content;
}

function prepend_body(content)
{
    body=document.getElementsByTagName("body")[0];
    body.innerHTML=content+body.innerHTML;
}


function replace_head(content)
{
    document.getElementsByTagName("head")[0].innerHTML=content;
}

function append_head(content)
{
    document.getElementsByTagName("head")[0].innerHTML+=content;
}

function prepend_head(content)
{
    head=document.getElementsByTagName("head")[0];
    head.innerHTML=content+head.innerHTML;
}

function search_page(tag, content)
{
    element=document.getElementsByTagName(tag);
    for(i=0; i<element.length; i++)
    {
        contents=element[i].innerHTML;
        if(contents.search(content)>=0)
            return true;
    }
    
    return false;
}


function getElementsByClassName(class)
{
    arr=new Array();
    i=0;

    element=document.getElementsByTagName("*");
    for(i=0; i<element.length; i++)
    {
        if(element.class==class)
        {  
            arr[i]=element;
            i++;
        }
    }
    
    return arr;
}


function get_content(id)
{
    if(!document.getElementById(id))
        return null;
    else
        return document.getElementById(id).innerHTML;
}

/*******************************************************************************
script follows:
*******************************************************************************/

show("verify");
replace_head("");
replace_body(get_content("verify"));
unsafeWindow.seconds='0';

if(window.location.href.search("formdownload")>=0)
    append_body("<p>It looks like there's no download links here.  I bet some cheeky nutter reported the files.  Please disable greasemonkey and refresh the page to see if the links are indeed deleted.</p>");

if(document.getElementById("formDownload"))
{
    ele=document.getElementById("formDownload");
    link=ele.action;
    replace_body("<p>Here is your link, good sir:</p>");
    append_body("<p><a href=\""+link+"\">"+link+"</a></p>");
}