Skip to content

Instantly share code, notes, and snippets.

@amjd
Created November 26, 2013 13:42
Show Gist options
  • Save amjd/7658401 to your computer and use it in GitHub Desktop.
Save amjd/7658401 to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$url = 'http://data.mtgox.com/api/1/BTCUSD/ticker_fast';
$resp = file_get_contents($url);
$res = json_decode($resp,true);
$result = $res['return']['last']['display'];
?>
<html>
<head>
<title>Bitcoin Rate</title>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta name='txtweb-appkey' content='ba0f03a3-d981-4a3e-be86-1ce4d0ce585c' />
</head>
<body>
<?php echo '1 BTC = ' . $result; ?>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment