YahooFinance

授权协议 未知
开发语言 Ruby
所属分类 Web应用开发、 WEB服务/SOAP/SOA
软件类型 开源软件
地区 不详
投 递 者 诸龙野
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

YahooFinance是一个从finance.yahoo.com获得股市信息的Ruby模块。它可以获取股票数据和历史数据。它能作为一个类库使用,也可以通过命令行调用。

安装方法:gem install yahoofinance

使用方法:

require 'yahoofinance'

# Set the type of quote we want to retrieve.
# Available type are:
# - YahooFinanace::StandardQuote
# - YahooFinanace::ExtendedQuote
# - YahooFinanace::RealTimeQuote
quote_type = YahooFinance::StandardQuote

# Set the symbols for which we want to retrieve quotes.
# You can include more than one symbol by separating
# them with a ',' (comma).
quote_symbols = "yhoo,goog"

# Get the quotes from Yahoo! Finance. The get_quotes method call
# returns a Hash containing one quote object of type "quote_type" for
# each symbol in "quote_symbols". If a block is given, it will be
# called with the quote object (as in the example below).
YahooFinance::get_quotes( quote_type, quote_symbols ) do |qt|
puts "QUOTING: #{qt.symbol}"
puts qt.to_s
end


# You can get the same effect using the quote specific method.
quotes = YahooFinance::get_standard_quotes( quote_symbols )
quotes.each do |symbol, qt|
puts "QUOTING: #{symbol}"
puts qt.to_s
end
  • http://www.lfyzjck.com/yahoo-finance-api/ 最近要做的一个网站需要在首页显示世界各大股票交易场所的综合指数,于是搜集了点这方面的资料,今天把研究的结果放出来。 提供财经方面讯息,做的比较好的应该是Google财经和Yahoo财经了,综合考虑还是Yahoo的接口比较好用 API使用方法比较简单,举个例子: http://finance.yahoo.com/d/

相关阅读

相关文章

相关问答

相关文档