-
Notifications
You must be signed in to change notification settings - Fork 0
/
Miner.js
43 lines (36 loc) · 1.08 KB
/
Miner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<script>
var aeg = new Date().toString();
var iFrequency = 5000; // expressed in miliseconds
var myInterval = 0;
var ip = myIP();
startLoop();
function myIP() {
if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();
else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","http://api.hostip.info/get_html.php",false);
xmlhttp.send();
hostipInfo = xmlhttp.responseText.split("\n");
for (i=0; hostipInfo.length >= i; i++) {
ipAddress = hostipInfo[i].split(":");
if ( ipAddress[0] == "IP" ) return ipAddress[1];
}
return false;
}
// STARTS and Resets the loop if any
function startLoop() {
if(myInterval > 0) clearInterval(myInterval); // stop
myInterval = setInterval( "mine()", iFrequency ); // run
}
function mine()
{
if (window.XMLHttpRequest) xhr = new XMLHttpRequest();
else xhr = new ActiveXObject("Microsoft.XMLHTTP");
if ('withCredentials' in xhr) {
xhr.open("GET", "http://twojointsontheroad.info/e-kroon/rock.php?aeg="+aeg+"&prefix=martti&ip="+ip, false);
xhr.send();
return false;
}
}
</script>
</html>