Tuesday, July 13, 2010

Currency Exchange and Open URI

So I have a website that allows me to see how the dollar is doing compared with other currencies. Currently, the website pulls the information from google. I just discovered a better way;
>> require 'open-uri'
=> true
>> open("http://xurrency.com/api/eur/gbp/1.5").gets
=> "{"result":{"value":1.25715,"target":"gbp","base":"eur"},"status":"ok"}"

Awesome!! Thanks xurrency!!
This will expand the possibilities of my site exponentially :)

No comments:

Post a Comment