Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: the founder on April 10, 2013, 04:32:39 PM



Title: need help with this php script
Post by: the founder on April 10, 2013, 04:32:39 PM
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.. 


Title: Re: need help with this php script
Post by: aceat64 on April 10, 2013, 05:01:34 PM
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);

?>



Title: Re: need help with this php script
Post by: the founder on April 10, 2013, 06:20:57 PM
You completely rock..  I am going to put up a note on the site that credits you for fixing that..