Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
committee_id = ARGV.shift
search = ARGV.join(" ")
if committee_id.nil? || search.nil?
puts <<-USAGE
Poor man's fec searchin'
poor-fec <committee_id> <search string>
USAGE
end
URL = "http://query.nictusa.com/cgi-bin/dcdev/forms/#{committee_id}"
ids = open(URL).read.scan(/HREF='(.*)\/'/).map(&:shift)
ids.each do |id|
data = open("http://query.nictusa.com/dcdev/posted/#{id}.fec").read
data.split("\n").each do |row|
puts row if row =~ /#{search}/i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.