AAAAAAAAAAAAAAAAAAAAAAAhhh!!!... I give up, javascript is not for me I think, this is the code i was trying to write, and below the @match.
I was trying that the script would bid each time the countdown reaches 2 seconds (e.g.)
Code:
// ==UserScript==
// @match http://www.subastaslocas.com.ar/Auctions/View.aspx?*
// ==/UserScript==
var timespaceing = 1;
var tiempominimo = 3;
//alert('checkeando subasta en ' + timespaceing + ' segundos');
var AuctionID = getParameterByName('AuctionID');
var campo = document.getElementById('counter_index_page_' + AuctionID);
var winner = document.getElementById('winner_index_page_' + AuctionID);
setTimeout(checksubasta, 7000);
function checksubasta()
{
if (campo==null)
{
//alert('no se encontro campo de subasta');
//setTimeout(checksubasta, timespaceing * 1000);
}
else
{
var tiemporestante = parseInt(document.getElementById('counter_index_page_' + AuctionID).innerHTML.slice(6,8),10);
if(tiemporestante < tiempominimo)
{
//alert('tiemporestante: ' + tiemporestante +'' | tiempominimo: " + tiempominimo);
subastar();
}
else
{
setTimeout(checksubasta, timespaceing * 1000);
}
}
}
function subastar()
{
//alert('subastar!');
var script = document.createElement('script');
script.setAttribute("type", "application/javascript");
script.textContent = 'BidAuction(' + AuctionID + ')();';
document.body.appendChild(script); // run the script
document.body.removeChild(script); // clean up
setTimeout(checksubasta, 10000);
}
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)')
.exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
Bookmarks