Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kings-Bucket

============

Ruby script for pulling the latest (or historical) currency data from OpenExchangeRates.org

Usage

To see a sample use of accessing the open exchange rates api data execute run bot file from the command line

require 'currency_data'

puts 'Instantiating a new CurrencyData object with your app id'
cd = CurrencyData.new('YOUR_APP_ID')

puts 'load the latest currency data and showing...'
cd.load_currency
cd.show

puts 'load historic currency data for September 4th, 2011 and showing...'
cd.load_currency('2011-09-04')
cd.show

note:You must sign up for a free app id at Open Exchange Rates. The free version allows for 1000 requests per month and 1 hour updates on rates. You can pay for more requests and 10 minute updates of rates.

Files

  • currency.rb

    For storing a single instance of a Currency object, including the symbol, name, and value in relation to base currency (USD)

  • currency_data.rb

    The CurrencyData object interfaces with the OpenExchange object and creates/stores Currency objects that it parses from the api data.

  • open_exchange.rb

    OpenExchange is the wrapper around the Open Exchange Rates api. Pull's the latest currency rates or historical currency rates. Also returns the local currencies.json file for creation of initial @currencies hash.

  • run_bot.rb

    Sample run of the script

  • currencies.json

    Local version of symbol => name data for all the currencies

About

Ruby script for pulling the latest (or historical) currency data exchange rates from OpenExchangeRates.org

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages