Jorge alejandro Mendoza torres
2010-Jun-04 22:39 UTC
Problems with Ruby on Rails and Mechanize gem?
Hi all.
I''m doing a web site using "WWW::Mechanize".
From my application, when I''m using the web site, I have a link, and
when I make click on the Iink, I want to log with my google mail, this
already works but now, I want to show the home page after logged.
This is my source:
require ''rubygems''
require ''mechanize''
def loggin
user =
''someone_user-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org''
pass = ''abc123''
agent = WWW::Mechanize.new
page = agent.get
''https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=1eic6yu9oa4y3&scc=1<mpl=default<mplcache=2''
form = page.forms.first
form.login = user
form.passwd = pass
page = agent.submit form
# I tried this, but it didn''t work
redirect_to ''https://mail.google.com/mail/?shva=1#''
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.