YahooFinance

码农软件 · 软件分类 · WEB服务/SOAP/SOA · 2019-04-10 09:28:48

软件介绍

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

本文地址:https://codercto.com/soft/d/3258.html

HTML5和CSS3实例教程

HTML5和CSS3实例教程

Brian P.Hogan / 李杰、刘晓娜、柳靖、朱嵬 / 人民邮电出版社 / 2012-1 / 39.00元

《HTML5和CSS3实例教程》共分3部分,集中讨论了HTML5和CSS3规范及其技术的使用方法。首先是规范概述,介绍了新的结构化标签、表单域及其功能(包括自动聚焦功能和占位文本)和CSS3的新选择器。接下来是HTML对视频和音频的支持,讲述了画布上的图形绘制及CSS阴影、渐变和变换的使用方法。最后介绍使用HTML5的客户端特性(包括WebStorage、WebSQLDatabases以及离线支持......一起来看看 《HTML5和CSS3实例教程》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具