Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (15 sloc) 0.434 kb
2cb9a4e @jnunemaker Added crack example.
authored
1 require 'rubygems'
2 require 'crack'
3
4 dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5 require File.join(dir, 'httparty')
6 require 'pp'
7
8 class Rep
9 include HTTParty
10
11 parser(
12 Proc.new do |body, format|
13 Crack::XML.parse(body)
14 end
15 )
16 end
17
18 pp Rep.get('http://whoismyrepresentative.com/whoismyrep.php?zip=46544')
19 pp Rep.get('http://whoismyrepresentative.com/whoismyrep.php', :query => {:zip => 46544})
Something went wrong with that request. Please try again.