github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

scottbarr / yahoo_currency

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 7
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Retrieve currency exchange rates from Yahoo! Finance. — Read more

  cancel

http://github.com/scottbarr/yahoo_currency/tree/master

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Updated to run under Ruby 1.8 and 1.9 
scottbarr (author)
Sat Mar 07 03:42:33 -0800 2009
commit  2e83f39337515a2368065b1ff4e02e9003be78c2
tree    6b155cdf3541b50ffa530f8e1e370da541db1969
parent  b87a487ffb7a6c84e79de83fa66727152aa2ffe2
yahoo_currency /
name age
history
message
file .gitignore Loading commit data...
file Manifest
file README.rdoc
file Rakefile
file config.yml
file init.rb
directory lib/
directory test/
file yahoo_currency.gemspec
README.rdoc

YahooCurrency

Retrieve currency exchange rates from Yahoo! Finance.

The Yahoo! Finance Service

URL to fetch the AUD to USD exchange rate

    http://download.finance.yahoo.com/d/quotes.csv?s=AUDUSD=X&f=nl1d1t1

Although the Yahoo! service supports multiple rates values from one request, this class does not yet support this functionality yet.

  $ curl "http://download.finance.yahoo.com/d/quotes.csv?s=USDCAD=X+JPYUSD=X+GBPUSD=X+USDJPY=X+EURUSD=X&f=nl1d1t1"
  "USD to CAD",1.0191,"6/18/2008","2:45am"
  "JPY to USD",0.0093,"6/18/2008","2:45am"
  "GBP to USD",1.9514,"6/18/2008","2:44am"
  "USD to JPY",108.085,"6/18/2008","2:45am"
  "EUR to USD",1.5493,"6/18/2008","2:44am"

Features

  • So easy to use, even a baby could find out what his currency is trading at.
  • Tested with Ruby 1.8.7 and 1.9.1

Example

  exchange_rate = YahooCurrency.get_rate!("JPY", "USD")
  exchange_rate.from #=> "JPY"
  exchange_rate.to #=> "USD"
  exchange_rate.rate #=> 0.0111
  exchange_rate.timestamp #=> Wed Feb 11 22:20:00 +0800 2009

References

  • gummy-stuff.org/forex.htm
  • www.thinkruby.org/tags/currency-converter
  • finance.yahoo.com/currency
  • gummy-stuff.org/Yahoo-data.htm

License

(The MIT License)

Copyright © 2009 Global IT Creations Pte Ltd www.globalitcreations.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server