Skip to content

Instantly share code, notes, and snippets.

@abstrctn
Created September 15, 2012 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstrctn/3727751 to your computer and use it in GitHub Desktop.
Save abstrctn/3727751 to your computer and use it in GitHub Desktop.
Fech demo
# 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