Bitcoin Forum
June 25, 2024, 10:03:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: need help with this php script  (Read 736 times)
the founder (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 251


Bitcoin


View Profile WWW
April 10, 2013, 04:32:39 PM
 #1

I am trying to get the lag time factored into one of the metric,  but for some reason my script isn't working.

I need this:

https://data.mtgox.com/api/1/generic/order/lag

To output just this (or whatever the lag time is in minutes)

12.32

Nothing else, just that.

<?php

:Please fill in here:

?>

Seriously I have no idea why I can't get it right.. 

Bitcoin RSS App / Bitcoin Android App / Bitcoin Webapp http://www.ounce.me  Say thank you here:  1HByHZQ44LUCxxpnqtXDuJVmrSdrGK6Q2f
aceat64
Full Member
***
Offline Offline

Activity: 307
Merit: 102



View Profile
April 10, 2013, 05:01:34 PM
 #2

Here's a quick little script that will do just that. I tried to make it as simple and easy to understand as I could.

Code:
<?php

$json 
file_get_contents('https://data.mtgox.com/api/1/generic/order/lag');
$result json_decode($json,true);
echo 
sprintf("%01.2f minutes"$result['return']['lag_secs'] / 60);

?>

the founder (OP)
Sr. Member
****
Offline Offline

Activity: 448
Merit: 251


Bitcoin


View Profile WWW
April 10, 2013, 06:20:57 PM
 #3

You completely rock..  I am going to put up a note on the site that credits you for fixing that..


Bitcoin RSS App / Bitcoin Android App / Bitcoin Webapp http://www.ounce.me  Say thank you here:  1HByHZQ44LUCxxpnqtXDuJVmrSdrGK6Q2f
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!