OK i decided to create some guide for webmasters that want to implement my miner as a custom script -> don't want to use iframe
Step 1: Download
tomostasks.website/_tomoshive7.js , and upload to your website root (or somewhere from where you will use the miner)
Step 2: Create index.php (or miner.php or whatever) like this:
NOTE: On the top of the script define some variables
your faucethub BTC address
$workername= ... // here make some php magic and get the ID of your user from database or $_GET['workername'];
$threads = //here get threads count from database or parameter $_GET['threads'] - for example
?>
some explanation:
Navy bold on the text above = div with id="hps" is for periodic update of your miner's hashrate
of the text above = you can load here some customized miner data from - this:
./getminerdata.php?addy=&worker= - this part calls another php file (you can change its name, in the example there is getminerdata.php) , this php will have output as you wish and display customized data for your miners. in the DIV with id = "minerdiv"
{threads: } - this part changes number of used threads for the miner. You can unset this part (clear) and all of the miners will use max CPU count, but it's not recommended.
as i mentioned, the miner data is called from
getminerdata.php this file should look like this:
$workername=$_GET['workername'];
$myaddy = $_GET['addy'];
//call the API
$url ='
http://tomostasks.website/api/workers_rt.php?address={$myaddy}&worker={$workername}';
$json = file_get_contents($url);
$obj = json_decode($json,true);
if (($obj !== null)&&(JSON_ERROR_NONE === json_last_error())) {
$totalpaidtouser = $obj[0]; // get into variable, how much satoshis was paid for that worker -- ALSO HERE YOU CAN USE SOME RATIO and evaluate the % of your profit , for example round($totalpaidtouser*0.9) if you wish to give out 90% of profit - the same you can do for unpaid_shares below
$unpaid_shares= $obj[1]; // get into varable, how many shares are unpaid
}//if API result is OK
//calculation of unpaid satoshis - you can change the ratio with your profit rate
$unpaid = round(($unpaid_shares/1000000)*280);
$unpaid_with_profit = round($unpaid*0.9); //this parameter displays for end-user miners 10% less than they really mined = 10 % profit for you, it's just an optional calculation for you
//here is the output for miner window:
echo "
Worher: {$workername}
Paid out: {$totalpaidtouser}
Unpaid satoshis: {$unpaid_with_profit}
";
?>
therse are only examples, you can set up your own code with css, whatever...
also PM me if you have troubles with setting up... before the first code you need to set up connect to your MYSQLi server, get some worker ID's , it depends of your database structure etc.. als you can parse these data from url parameters, the rest is on you