Created
September 15, 2012 13:05
-
-
Save abstrctn/3727751 to your computer and use it in GitHub Desktop.
Fech demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Fech | |
gem install fech | |
# Go into IRB and load Fech | |
irb | |
require 'rubygems' | |
require 'fech' | |
# Initialize a Filing object. This one is from Tim Pawlenty's (late) presidential campaign. | |
filing = Fech::Filing.new(723604) | |
# Download | |
filing.download | |
# Basic usage | |
filing.summary | |
filing.header | |
filing.rows_like(/sa/) | |
filing.rows_like(/sb/) | |
# Get the value of every contribution | |
filing.rows_like(/sa/).map(&:contribution_amount) | |
# Comparison | |
filing_1 = Fech::Filing.new(767437) | |
filing_1.download | |
filing_2 = Fech::Filing.new(751798) | |
filing_2.download | |
comparison = Fech::Comparison.new(filing_1, filing_2) | |
comparison.summary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment