No commit activity in last 3 years
No release in over 3 years
Provides high-performance access to historic stock data from Yahoo! Finance
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

yahoofinance-typhoeus¶ ↑

Yahoo! Finance in Ruby. Downloads historic data with the Typhoeus library. This project is not endorsed by or connected with Yahoo! in any way.

Copyright © 2010 Paul Legato. All rights reserved. Licensed under the BSD-new license: See LICENSE for details.

Usage¶ ↑

YahooFinance-Typhoeus is designed to be both highly efficient and easy to use.

Parallel queries (efficient)¶ ↑

When you instantiate a new YahooFinance object, you can tell it how many parallel HTTP requests to make at once. The default is 20. This seems low, but it’s designed to keep you out of trouble by avoiding DoSing Yahoo’s servers. You change it at your own risk!

require 'rubygems'
require 'yahoofinance-typhoeus'

yf = YahooFinance.new # or YahooFinance.new(max_number_of_concurrent_connections)

yf.add_query("AAPL", "2008-12-01", "2008-12-15") {|response| puts response}
yf.add_query("IBM", "2008-10-15", "2008-10-30") {|response| puts response}

yf.run

That’s all there is to it.

Quick, one-off query (inefficient)¶ ↑

require 'rubygems'
require 'yahoofinance-typhoeus'

YahooFinance.quick_query("AAPL", "2009-01-01", "2009-02-01")

Note that as quick_query is intended for one-off requests, it does NOT take advantage of libcurl/typhoeus’ concurrent HTTP connections features.

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.