bahuvrihi / tap-mechanize

Tap tasks for submitting http requests.

This URL has Read+Write access

README
= {Tap Mechanize}[http://tap.rubyforge.org/projects/tap-mechanize]

A task library for submitting http requests using Tap[http://tap.rubyforge.org] and 
Mechanize[http://mechanize.rubyforge.org]

== Description

Tap::Mechanize provides tasks and controllers to automate interaction with
websites, and in particular with web applications. Tap::Mechanize provides a
{Ubiquity}[http://labs.mozilla.com/2008/08/introducing-ubiquity/] command to
redirect and capture HTTP requests as YAML. The resulting request
configuration files can be edited and resubmitted using a Request task.
Multi-step actions, file uploads, and actions that require the use of HTTPS
may all be automated in this way.

* Lighthouse[http://bahuvrihi.lighthouseapp.com/projects/20532-tap-mechanize/overview]
* Github[http://github.com/bahuvrihi/tap-mechanize/tree/master]
* {Google Group}[http://groups.google.com/group/ruby-on-tap]

=== Usage

Tap::Mechanize submits HTTP requests using the Tap::Mechanize::Submit task.
Headers and parameters may be specified, but only a uri is required.

  r = Tap::Mechanize::Submit.new
  r.process(:uri => 'http://www.google.com')[0, 80]
  # => "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859" 

=== Capturing Web Forms

HTTP requests from web forms may be captured and resubmitted using a
combination of tools. First start a tap server from the command line:

  % tap server

Now open a browser and work through the tutorial: http://localhost:8080/capture/tutorial

The current capture scripts redirect via the onsubmit and onclick events in a
web page. This works in most cases, but is known to fail in some circumstances
(ex Java Server Pages). A workaround exists using the {Live HTTP
Headers}[https://addons.mozilla.org/en-US/firefox/addon/3829] addon. Start a
web server and see http://localhost:8080/capture/http.

== Installation

Tap::Mechanize is available as a gem on
RubyForge[http://rubyforge.org/projects/tap]. Use:

  % gem install tap-mechanize

Note this package was once called tap-http.

== Info 

Copyright (c) 2008-2009, Regents of the University of Colorado.
Developer:: {Simon Chiang}[http://bahuvrihi.wordpress.com], {Biomolecular Structure Program}[http://biomol.uchsc.edu/], 
{Hansen Lab}[http://hsc-proteomics.uchsc.edu/hansenlab/] 
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
Licence:: {MIT-Style}[link:files/MIT-LICENSE.html]