HTTPal is a Ruby library that behaves more like a regular web browser than Net::HTTP does - it keeps state around between requests. This is incredibly useful for automating scripts that log in and perform actions on sites using cookied sessions, referer tracking, etc.

Usage is a page that in the absence of a cookie, sets one and prints ‘hope you lok’. In the presence of a cookie, it prints 'you do’.

irb(main):001:0> require 'lib/httpal'
=> true
irb(main):002:0> b =
=> #
irb(main):003:0> b.get('').body
=> "hope you lok"
irb(main):004:0> b.get('').body
=> "you do"
irb(main):005:0> {
irb(main):006:1* puts get('').body
irb(main):007:1> puts get('').body
irb(main):008:1> }
hope you lok
you do
=> nil

You can call the get and post methods either directly on the object, or from within a block sent to the use method (because I thought that would be awesome).

Getting It

# unstable = I love to break this version for fun whenever I want
svn co httpal

# first tested public release
svn co test  

Don’t expect a regular schedule for tagged/tested releases - for now this project is pretty much on an as-I-need-it basis.

Whining about Reporting bugs

Send bug reports to after checking Trac to see if they’re fixed. Ticket submission’s not on Trac because it’s a spam magnet and I don’t feel like putting up with it.