Bitcoin Forum
December 17, 2017, 01:11:32 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin faucet rotator script help  (Read 356 times)
RBCastro
Member
**
Offline Offline

Activity: 106


View Profile
November 04, 2015, 06:40:32 PM
 #1

Hello.

I got the "WinCoins 1.0" faucet script but I would like to improve one function on it.

On the page of the faucet, I would like to put a href link to the current url.

This is the bitcoin.js file that are the urls:

Code:
var s=[
"faucet1.html",
"faucet2.html",
"faucet3.html",
];
var adr,i,x=0,c=s.length;
function address() {
adr=prompt('Enter your bitcoin address:');
s=s.map(function(x){
  return x.indexOf("a=") != -1 ? x + adr : x;
});
}
function next(){
x+=1;
if (x>c-1)
  {
  x=0;
  }
changeSrc();
}
function prev(){
x-=1;
if (x<=0)
  {
  x=c-1;
  }
changeSrc();
}
function jumpTo() {
i=prompt("Enter a number to skip to that faucet.");
x=0;
while (i!=x) {
  if (x>c-2) {
  break;
  }
  x+=1;
}
changeSrc();
}
function newTab() {
var win=window.open(document.getElementById("fm").src, '_blank');
win.focus();
}
function changeSrc() {
document.getElementById("fm").src=s[x];
}

Where "fm" is the id of the iframe on the bitcoin.php page:

Code:
<div class="frame">
    <iframe id="fm" name="fm" src="faucet1.html" frameborder="0" scrolling="auto"></iframe>
</div>

I tryed to place this code on bitcoin.php:

Code:
<a href="<?php echo $s[x]; ?>"> open current faucet </a>

But it return me the bitcoin.php link, not the url that the iframe is showing.

Can anyone help me with that?


Thanks
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!