Binya
Binya is a Ruby library for parsing information from Federal Reserve sites. Its initial utility is to parse a listing of speeches, testimony and other comments by Federal Open Market Committee participants and return Ruby objects. It also provides details about the FOMC participants via a YAML file that can be loaded. More examples and explanations in the docs.
Binya is named for Binyamin Applebaum, a Washington correspondent for The New York Times.
Binya is tested under Ruby 1.9.3.
Installation
Add this line to your application's Gemfile:
gem 'binya'
And then execute:
$ bundle
Or install it yourself as:
$ gem install binya
Tests
To run the tests, run rake test
. Binya uses MiniTest.
Usage
require 'rubygems'
require 'binya'
# scrapes http://www.stlouisfed.org/fomcspeak/date.aspx
results = Binya::Remarks.fetch_html
puts results.first
=> <Binya::Remarks:0x007f987b8f2dc8 @date=#<Date: 2013-07-02 ((2456476j,0s,0n),+0s,2299161j)>, @time=2013-07-02 17:45:00 -0400, @participant="Jerome H. Powell", @participant_id=22, @type="Speech", @location="The University Club, New York, N.Y.", @title="International Financial Regulatory Reform ", @url="http://www.federalreserve.gov/newsevents/speech/powell20130702a.htm">
# pulls from rss feeds of FOMC participants - this puts type, location and title into a single field
latest_from_rss = Binya::Remarks.latest
# loads the FOMC participants
fomc = Binya::Participant.load_all
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request