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_u...@gmail.com'
    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&ltmpl=default&ltmplcache=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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to