Hallo habe heute mal mit Coinhive rumprobiert und den Miner eingefügt:
PHP Code:
<script src="https://authedmine.com/lib/simple-ui.min.js" async></script>
<div class="coinhive-miner"
style="width: 100%; height: 20%"
data-key="....."
data-autostart="false"
data-whitelabel="false"
data-background="#000000"
data-text="#eeeeee"
data-action="#00ff00"
data-graph="#555555"
data-threads="4"
data-user="Asmodis"
data-throttle="0.1">
<em>Hallo Asmodis, bitte warte einen Moment...</em>
</div>
Nun möchte ich von diesem User die Balance auslesen und habe die PHP Klasse von denen Verwendet jedoch bekomme ich eine weise Seite

Das ist die Klasse mit meiner Versuchten Option:
PHP Code:
<?php
class CoinHiveAPI {
const API_URL = 'https://api.coinhive.com';
private $secret = null;
public function __construct($secret) {
if (strlen($secret) !== 32) {
throw new Exception('CoinHive - Invalid Secret');
}
$this->secret = $secret;
}
function get($path, $data = []) {
$data['secret'] = $this->secret;
$url = self::API_URL.$path.'?'.http_build_query($data);
$response = file_get_contents($url);
return json_decode($response);
}
function post($path, $data = []) {
$data['secret'] = $this->secret;
$context = stream_context_create([
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
]
]);
$url = SELF::API_URL.$path;
$response = file_get_contents($url, false, $context);
return json_decode($response);
}
}
$coinhive = new CoinHiveAPI('......');
$user = $coinhive->get('/user/balance', ['name' => 'Asmodis']);
echo $user->balance;
?>
Kann eventuell jemand ein Beispiel Posten wie ich von diesem es Anzeigen lassen kann?
Vielen Dank!
LG
ps. Frohe Weihnachten!