Bitcoin Forum
December 07, 2016, 06:31:15 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: HELP! Need to automate live bitcoin exchange rate.  (Read 1743 times)
Bobby
Newbie
*
Offline Offline

Activity: 12


View Profile
March 04, 2011, 12:14:03 AM
 #1

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

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481135475
Hero Member
*
Offline Offline

Posts: 1481135475

View Profile Personal Message (Offline)

Ignore
1481135475
Reply with quote  #2

1481135475
Report to moderator
1481135475
Hero Member
*
Offline Offline

Posts: 1481135475

View Profile Personal Message (Offline)

Ignore
1481135475
Reply with quote  #2

1481135475
Report to moderator
1481135475
Hero Member
*
Offline Offline

Posts: 1481135475

View Profile Personal Message (Offline)

Ignore
1481135475
Reply with quote  #2

1481135475
Report to moderator
Quip
Jr. Member
*
Offline Offline

Activity: 56


View Profile
March 04, 2011, 12:22:36 AM
 #2

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.

1NEEFwHjXDhbLZ2RxM6qSDnNDByNZYCSKf

LVBX is down indefinitely, so use CoinPal. Sorry.
slush
Legendary
*
Offline Offline

Activity: 1358



View Profile WWW
March 04, 2011, 12:40:28 AM
 #3

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!

Bobby
Newbie
*
Offline Offline

Activity: 12


View Profile
March 04, 2011, 12:56:08 AM
 #4

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

Thanks!
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!