Create the following shell script somewhere in your PATH, make it executable (chmod 755 script_name), and you've got a simple currency converter in the Terminal. Note that you'll need to have lynx installed to use it -- it's available via Fink. Note also that the /sw/bin... line below should be one long line; remove the line break, and don't add any spaces when doing so.
#!/bin/tcsh -f
/sw/bin/lynx -nolist -dump 'http://finance.yahoo.com/currency/convert?amt='$1'
&from='$2'&to='$3'&submit=Convert' | grep $2$3 | sed -e 's/[ ]*//' | awk '{print $6}'
exit 0
You'll need to know the abbreviations for each currency to use the script -- here's a list; these are also visible in the pop-up on the Yahoo Currency Converter. To convert, use the program like this:
conv_curr amount from_unit to_unit
For example, here's how to convert 100 US Dollars (USD) into Gambian Dalasis (GMD):
$ conv_curr 100 USD GMD
2,285.00
[robg adds: This hint, as submitted, consisted of only the script and the list of country codes, so nearly all of what you see above (including any mistakes!) is my writing. This should work just as well with links instead of lynx, and it should be possible to do something similar with curl, though I suspect it would take more work.]
•
[11,678 views]

