File: /var/www/www-root/data/www/NEWs/news.automoon.click/inc/cron/course/cron_parser.php
<?php
//if ($_GET['key'] != 'c777') { exit(); }
$usd = file_get_contents('https://api.cryptonator.com/api/ticker/usd-rub');
$usd_parsed = json_decode($usd, true);
$res_usd = $usd_parsed['ticker']['price'];
$res_usd_c = $usd_parsed['ticker']['change'];
$eur = file_get_contents('https://api.cryptonator.com/api/ticker/eur-rub');
$eur_parsed = json_decode($eur, true);
$res_eur = $eur_parsed['ticker']['price'];
$res_eur_c = $eur_parsed['ticker']['change'];
$res_usd = number_format($res_usd, 2, '.','');
$res_usd_c = number_format($res_usd_c, 2, '.',''); if ($res_usd_c == 0) { $res_usd_c = '0.01'; } if ($res_usd_c >0) { $res_usd_c = '+'.$res_usd_c;}
$res_eur = number_format($res_eur, 2, '.','');
$res_eur_c = number_format($res_eur_c, 2, '.',''); if ($res_eur_c == 0) { $res_eur_c = '0.01'; } if ($res_eur_c >0) { $res_eur_c = '+'.$res_eur_c;}
$res = $res_usd.'|'.$res_usd_c.'|'.$res_eur.'|'.$res_eur_c;
file_put_contents('result.txt', $res);
exit;