Created
August 30, 2010 14:38
-
-
Save ybenjo/557496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
require 'hpricot' | |
require 'open-uri' | |
agent = Mechanize.new | |
agent.user_agent_alias = 'Windows IE 7' | |
page = agent.get("https://twitter.com/login") | |
f = page.forms[0] | |
f["session[username_or_email]"] = "username" | |
f["session[password]"] = "password" | |
page = agent.submit(f) | |
######## | |
puts Hpricot(page.body).inner_text | |
page = agent.get("http://twitter.com/Wagnaria/followers") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment