Author

Topic: HELP! Need to automate live bitcoin exchange rate. (Read 1979 times)

newbie
Activity: 12
Merit: 0
Exactly what I needed!  No longer BitCoin related but does anyone know a script that can fetch the spot price of Gold/Silver??

Thanks!
legendary
Activity: 1386
Merit: 1097
Since my website is written in PERL/CGI

Try to search recent forum posts, yesterday somebody posted PERL code for parsing mtgox quotes...

Edit: Link to Perl module is on the wiki. Nice job, mndrix!
newbie
Activity: 56
Merit: 0
No idea about perl, but in PHP:
Code:
$goxPrice = json_decode(file_get_contents("http://mtgox.com/code/data/ticker.php"))->{'ticker'}->{'sell'};
You can use "buy", "sell", or "last" based on your needs.
newbie
Activity: 12
Merit: 0
Basically I'm going to be selling certain items on my website such as Gold, Silver coins, etc.  I would like to accept bitcoin in payment but I need to be able to update the price in accordance to the bitcoin/USD exchange rate.  Since my website is written in PERL/CGI is there an easy way to obtain the latest exchange rate (current BID on MTGOX for example) and import it into a variable that I would use to update my prices in real time?  It's easy to look up manually but how would I write a script that would be able to look up the value?

Also would need to look up the spot price of Gold and Silver (in USD) at the same time.

There seem to be a lot of geniouses here so thanks in advance for any advice!

Bobby

Jump to: