'local-sample.php', //'EPSYTOUR'=>'epsytour.php', /* copy local.php file and edit target IP:PORT */ ); function getdataFromPears() { global $host, $configs; $data = array(); foreach ($configs as $name => $conf) { $json = file_get_contents($host.$conf); $data[$name] = json_decode($json, TRUE); } return $data; } function translateField($key) { $intl = array(); $intl['NAME'] = 'Software'; $intl['VER'] = 'Version'; $intl['ALGO'] = 'Algorithm'; $intl['KHS'] = 'Hashrate (kH/s)'; $intl['ACC'] = 'Accepted shares'; $intl['ACCMN'] = 'Accepted / mn'; $intl['REJ'] = 'Rejected'; $intl['UPTIME'] = 'Miner uptime'; $intl['TEMP'] = 'T°c'; $intl['FAN'] = 'Fan %'; if (isset($intl[$key])) return $intl[$key]; else return $key; } function displayData($data) { $htm = ''; foreach ($data as $name => $stats) { $htm .= ''."\n"; $htm .= '\n"; foreach ($stats['summary'] as $key=>$val) { if (!empty($val)) $htm .= ''. '\n"; } foreach ($stats['stats'] as $g=>$gpu) { $htm .= '\n"; foreach ($gpu as $key=>$val) { if (!empty($val)) $htm .= ''. '\n"; } } $htm .= "
'.$name."
'.translateField($key).''.$val."
'.$g."
'.translateField($key).''.$val."
\n"; } return $htm; } $data = getdataFromPears(); ?> ccminer rig api sample