Author

Topic: Mtgox rate in my webpage? (Read 630 times)

newbie
Activity: 28
Merit: 0
December 04, 2013, 06:13:35 AM
#3
Thanks a bunch. Will try that..

I guess there is a way to show btc-e rates too if I choose BTC and LTC price. Would be grateful if you help me with that.
Appreciated +1
member
Activity: 99
Merit: 10
December 04, 2013, 06:07:00 AM
#2
There's probably a better way to do it, but you can do it like this:

Two pages, you can change the refresh interval in index.php

Page 1 = index.php -



      Bitcoin Price
      
      
      
      

      
      
      



Wait 10 Seconds..






Page 2 = gox.php -

header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.

$data = file_get_contents("https://data.mtgox.com/api/2/BTCUSD/money/ticker_fast");
$data = json_decode($data, true);
$spot_last = $data['data']['last']['value'];
print_r($spot_last);
?>

Try That.
newbie
Activity: 28
Merit: 0
December 04, 2013, 05:55:05 AM
#1
How can I show the mtgox value on my webpage?
Any coding? or a simple script?

thank you.
Jump to: