Skip to content

Instantly share code, notes, and snippets.

@takuya
Created March 24, 2018 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuya/c92c5ffd2e0e62aa7d2b89042aa2adee to your computer and use it in GitHub Desktop.
Save takuya/c92c5ffd2e0e62aa7d2b89042aa2adee to your computer and use it in GitHub Desktop.
require 'mechanize'
m = Mechanize.new
m.get 'http://t.co'
return if m.page.uri.to_s =~ %r'^https?://t.co'
m.page.forms[0].submit
m.page.form( :action=> /email/ )
f = m.page.form( :action=> /email/ )
f.field( :type => /mail/ ).value = 'yormail@example.com'
f.submit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment