Oron Download Helper Greasemonkey Script

Here’s a very simple script I made that will automatically refresh a download from Oron.com

It won’t automatically start the download because you have to decode a captcha. This script will read the wait time, wait that specified amount of time, alert you when the wait is over and then refresh the page for you.

Download Greasemonkey Script.

Code after the break.

// ==UserScript==
// @name           oron
// @namespace      none
// @include        http://oron.com/*
// ==/UserScript==

//http://cal.freeshell.org

function ref()
{
alert("Oron download ready!");
location.reload(true);
}

var text = document.getElementsByTagName('body')[0].innerHTML;

var checkreg = new RegExp("You have to wait");

var check = text.match(checkreg);

if (check!=null)
{
var hours = new RegExp("[0-9]+? hours");
var mins = new RegExp("[0-9]+? minute");
var secs = new RegExp("[0-9]+? seconds");
var hour = new RegExp("[0-9]+? hour");
var min = new RegExp("[0-9]+? minute");
var sec = new RegExp("[0-9]+? second");
var num = new RegExp("[0-9]+?");

var h2 = text.match(hour).toString();
var m2 = text.match(min).toString();
var s2 = text.match(sec).toString();

if (h2!=null){
var h = h2.match(num);
}
else {
var h = 0;
}

if (m2!=null){
var m = parseInt(m2.match(num));
}
else {
var m = 0;
}

if (s2!=null){
var s = parseInt(s2.match(num));
}
else {
var s = 0;
}

time = ((h*3600000)+(m*60000)+(s*1000));

if (parseInt(time)>0)
{
time = (time+5000);
setTimeout(ref, parseInt(time));
}
}
This entry was posted in Greasemonkey and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

One Response to Oron Download Helper Greasemonkey Script

  1. Joe says:

    How do you use these scripts in greasemonkey?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *