Module Finance::Quote::Yahoo
In: lib/finance/quote/yahoo/asia.rb
lib/finance/quote/yahoo/europe.rb
lib/finance/quote/yahoo/usa.rb
lib/finance/quote/yahoo/australia.rb
lib/finance/quote/yahoo.rb

This module interfaces with Yahoo‘s financial data services. It is not intended for direct use by the user, but instead implements methods for use by other Yahoo-related modules.

On the other hand, this module may be of interest to you if you are intending to implement an extension module that retrieves information via Yahoo.

Classes and Modules

Module Finance::Quote::Yahoo::Asia
Module Finance::Quote::Yahoo::Australia
Module Finance::Quote::Yahoo::Europe
Module Finance::Quote::Yahoo::USA

Constants

MAX_REQUEST_SIZE = 40   This is the maximum number of stocks we‘ll batch into a single operation. If this gets too big (> 50 or thereabouts), things will break, because some proxies and/or webservers cannot handle very large URLs.
LABELS = %w[ symbol name last date time net p_change volume bid ask close open day_range year_range eps pe div_date div div_yield cap ex_div avg_vol ].map { |label| label.to_sym }   Yahoo encodes the desired fields as 1 or 2 character strings in the URL. These are recorded below, along with their corresponding field names.
FIELD_ENCODING = %w[ s n l1 d1 t1 c1 p2 v b a p o m w e r r1 d y j1 q a2 ]
CURRENCY_TAGS = { :US => 'USD', # USA AMEX, Nasdaq, NYSE :OB => 'USD', # USA OTC Bulletin Board :PK => 'USD', # USA Pink Sheets :BA => 'ARS', # Argentina Buenos Aires :VA => 'EUR', # Austria Vienna :AX => 'AUD', # Australia :SA => 'BRL', # Brazil Sao Paolo :TO => 'CAD', # Canada Toronto :V => 'CAD', # Toronto Venture :SN => 'CLP', # Chile Santiago :SS => 'CNY', # China Shanghai :SZ => 'CNY', # Shenzhen :CO => 'DKK', # Denmark Copenhagen :PA => 'EUR', # France Paris :BE => 'EUR', # Germany Berlin :BM => 'EUR', # Bremen :D => 'EUR', # Dusseldorf :F => 'EUR', # Frankfurt :H => 'EUR', # Hamburg :HA => 'EUR', # Hanover :MU => 'EUR', # Munich :SG => 'EUR', # Stuttgart :DE => 'EUR', # XETRA :HK => 'HKD', # Hong Kong :BO => 'INR', # India Bombay :CL => 'INR', # Calcutta :NS => 'INR', # National Stock Exchange :JK => 'IDR', # Indonesia Jakarta :TA => 'ILS', # Israel Tel Aviv :MI => 'EUR', # Italy Milan :KS => 'KRW', # Korea Stock Exchange :KQ => 'KRW', # KOSDAQ :KL => 'MYR', # Malaysia Kuala Lampur :MX => 'MXP', # Mexico :NZ => 'NZD', # New Zealand :AS => 'EUR', # Netherlands Amsterdam :OS => 'NOK', # Norway Oslo :LM => 'PEN', # Peru Lima :SI => 'SGD', # Singapore :BC => 'EUR', # Spain Barcelona :BI => 'EUR', # Bilbao :MF => 'EUR', # Madrid Fixed Income :MC => 'EUR', # Madrid SE CATS :MA => 'EUR', # Madrid :ST => 'SEK', # Sweden Stockholm :TW => 'TWD', # Taiwan Taiwan Stock Exchange :TWO => 'TWD', # OTC :BK => 'THB', # Thailand Thailand Stock Exchange :TH => 'THB', # ??? from asia.rb, (in Thai Baht) :L => 'GBP'   Yahoo uses a suffix on the stock symbol to denote the exchange on which the stock is traded. Use this suffix to map from the stock symbol to the currency in which its prices are reported.

[Validate]