/ Published in: Ruby
URL: http://www.arnebrasseur.net
Command line currency convertor, just copy and paste. I named mine 'coin'. Make sure you have Ruby, Rubygems and Hpricot (gem install hpricot).
e.g. ~$ coin 100 eur usd 158.3300
Uses the site xurrency.com.
Expand |
Embed | Plain Text
#!/usr/bin/env ruby -w unless ARGV.length == 3 puts "\tUsage :\n\t\t#{File.basename($0)} 100 eur usd" exit end require 'ubygems' require 'open-uri' require 'hpricot' url = "http://xurrency.com/#{ARGV.join('/')}/feed" doc=Hpricot(open(url).read) puts (doc/'dc:value').inner_html
Comments
Subscribe to comments
You need to login to post a comment.

The API changed so this no longer works.
Note that Google can do this, e.g. type "100 EUR in USD" in the search box.