Adding support for public API polling

* Does not require a token
* Returns basic status as taken from default mmcfe

Addresses #111
This commit is contained in:
Sebastian Grewe 2013-06-05 11:49:08 +02:00
parent f59f7e9fb0
commit aff116849c

View File

@ -0,0 +1,26 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
// {"pool_name":"Pool-X.eu","hashrate":"511128.99","workers":"2104","shares_this_round":92450,"last_block":"365294","network_hashrate":17327056.06}
// Fetch last block information
$aLastBlock = $block->getLast();
$aShares = $statistics->getRoundShares();
echo json_encode(
array(
'pool_name' => $config['website']['name'],
'hashrate' => $statistics->getCurrentHashrate(),
'workers' => $worker->getCountAllActiveWorkers(),
'shares_this_round' => $aShares['valid'],
'last_block' => $aLastBlock['height'],
'network_hashrate' => '0'
)
);
// Supress master template
$supress_master = 1;
?>