Bitcoin Forum

Economy => Services => Topic started by: havardr on April 13, 2013, 11:27:05 AM



Title: Looking for a script to show prices
Post by: havardr on April 13, 2013, 11:27:05 AM
Hi

I'm loking for a PHP script to show the last price on MtGox. This is to be used on a website.
Anyone have this available?


Title: Re: Looking for a script to show prices
Post by: BigBitz on April 13, 2013, 11:46:26 AM
I believe I can help you out. Is there an offer of BTC for this work?

Would you like me to access your server and configure or just provide the code?


Title: Re: Looking for a script to show prices
Post by: fsb4000 on April 13, 2013, 11:54:39 AM
look here:
https://github.com/neofutur/bitcoin_simple_php_tools/blob/master/textprice/pricetobtc.txt.php


Title: Re: Looking for a script to show prices
Post by: 🏰 TradeFortress 🏰 on April 13, 2013, 03:41:43 PM
Can do it for you for 1 BTC + support.


Title: Re: Looking for a script to show prices
Post by: TheButterZone on April 23, 2013, 12:21:01 AM
btcticker.appspot.com


Title: Re: Looking for a script to show prices
Post by: n4ru on April 23, 2013, 10:01:43 AM
Hi

I'm loking for a PHP script to show the last price on MtGox. This is to be used on a website.
Anyone have this available?
Sure, here you go :)
Variable $last is the last price.
Code:
<?php
        $ch 
curl_init('https://data.mtgox.com/api/2/BTCUSD/money/ticker');
                
curl_setopt($chCURLOPT_REFERER'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
                
curl_setopt($chCURLOPT_USERAGENT"CakeScript/0.1");
                
curl_setopt($chCURLOPT_HEADER0);
                
curl_setopt($chCURLOPT_RETURNTRANSFER1);
                
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
                
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
                
$mtgoxjson curl_exec($ch);
                
curl_close($ch);
                
$output_mtgox json_decode($mtgoxjson);
                
$output_mtgox_1 get_object_vars($output_mtgox);
                
$mtgox_array get_object_vars($output_mtgox_1['data']);
$data get_object_vars($mtgox_array['last']);
$last $data['value'];        
?>

If this helped you out, I would appreciate a donation of any size - 1JFs4LNkRF4t96r8EJ6FNaaLmcY9SQGEmG