Skip to content

Commit

Permalink
Added crack example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Oct 5, 2011
1 parent c1bcd31 commit 2cb9a4e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/crack.rb
@@ -0,0 +1,19 @@
require 'rubygems'
require 'crack'

dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'httparty')
require 'pp'

class Rep
include HTTParty

parser(
Proc.new do |body, format|
Crack::XML.parse(body)
end
)
end

pp Rep.get('http://whoismyrepresentative.com/whoismyrep.php?zip=46544')
pp Rep.get('http://whoismyrepresentative.com/whoismyrep.php', :query => {:zip => 46544})

0 comments on commit 2cb9a4e

Please sign in to comment.