Created
October 26, 2009 21:14
-
-
Save cdecker/219047 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Klick4 | |
// @namespace net.snyke | |
// @include *?content=/verdienen/klick4 | |
// ==/UserScript== | |
window.count = 10; | |
setTimeout(function(){ | |
var nodes = document.evaluate("//a[contains(@href,'fc.php')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); | |
console.log(nodes); | |
for ( var i=0 ; i < nodes.snapshotLength; i++ ){ | |
var iframe = document.createElement("iframe"); | |
var link = nodes.snapshotItem(i); | |
iframe.src = link.href; | |
iframe.width = 468; | |
iframe.height = 60; | |
link.parentNode.insertBefore(iframe,link); | |
link.parentNode.removeChild(link); | |
} | |
// Aufenthalt: 72 Sekunden | |
var reloadPattern = /Aufenthalt: ([0-9]+) Sekunden/g | |
var content = document.body.textContent; | |
var times = content.match(reloadPattern, "$1"); | |
var reloadTime = 0; | |
for(var i in times){ | |
var st = "Aufenthalt: "; | |
var e = " Sekunden" | |
var time = times[i].substr(st.length); | |
time = time.substr(0,time.length - e.length); | |
reloadTime = (reloadTime<time?time:reloadTime); | |
console.log(reloadTime); | |
} | |
window.count = parseInt(reloadTime); | |
window.count += 5; | |
},5000); | |
setInterval(function(){ | |
window.count--; | |
if(window.count == 0) | |
document.location.reload(); | |
else | |
document.title = count; | |
},1000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment