Skip to content

Instantly share code, notes, and snippets.

@johnnygoodman
Created August 4, 2010 14:20
Show Gist options
  • Save johnnygoodman/508198 to your computer and use it in GitHub Desktop.
Save johnnygoodman/508198 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mechanize'
require 'date'
require 'logger'
agent = Mechanize.new { |a| a.log = Logger.new("mech.log") }
agent.follow_meta_refresh = true
page = agent.get 'https://www.cpap.com/MadCowModular/main.php'
form = page.forms.first
form.Username = MADCOW['username']
form.Password = MADCOW['password']
page = agent.submit form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment