Forum: Ruby on Rails How to wait and check for login to an external site

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
kevin l. (Guest)
on 2008-11-28 01:58
Hi I am working on a event calendar app that I would like a user to be
able to save an event they selected to an online calendar such as Google
Calendar.  I have a link to Google C. a user can click to open it
in a new tab once the user selected an event.  I don't need to save user
email info so the best approach I think is to wait for the user to log
into the Google app and then my code adds the selected event into the
calendar.

I guess I need to have a loop (with a timeout) in an action checking to
see if the user has logged in.  My idea is to try to get the url of the
logged in page using Mechanize like this: page =
agent.get("https://www.google.com/calendar/render").  This is perhaps a
dumb idea.  Or do I really need to capture the login event somehow.

What should I do to accomplish this goal?  What tool (gem) I should use
to do this?  Please put me on the right track with some guidelines or
link to resources, thanks!
Andrew B. (Guest)
on 2008-11-28 07:23
(Received via mailing list)
check out the google calendar API docs, instead of using mechanize and
scraping the page.
http://code.google.com/apis/calendar/docs/2.0/deve...

On Nov 27, 5:58 pm, kevin lee <removed_email_address@domain.invalid>
kevin l. (Guest)
on 2008-12-01 05:43
Thank you very much for the big hint!
kevin l. (Guest)
on 2008-12-09 19:16
I was able to use AuthSub to retrieve a token from Google but it
redirect back to my app and closed the Google webpage.  This is not
exactly what I want to do.  What I actually want to do is to interact
with Google C. the way many other similar applications, such as
Zvents, do, which is direct user to Google C. account login page,
wait for user to login, and keep Google C. open in order to save
the event.  These apps link to Google C. with a url that looks
like this:  https://www.google.com/accounts/ServiceLogin?service...  I
have not been able to find any reference to this url in the Google
Account Authentication API.  Any idea where is it covered in the
document or this is something else entirely?  Or that I simply need to
dig deeper into AuthSub to achieve my goal?  I would again appreciate
any guidance.  Thanks!
kevin l. (Guest)
on 2008-12-19 01:08
How do I process the Google token received by using AuthSub after it is
passed to my controller (I don't have an index action but map.connect
defaults to index) because I make the request to Google from the main
page of my app?  Is it possible?  Or must I make a request inside an
action?  Thanks!








kevin lee wrote:
> I was able to use AuthSub to retrieve a token from Google but it
> redirect back to my app and closed the Google webpage.  This is not
> exactly what I want to do.  What I actually want to do is to interact
> with Google C. the way many other similar applications, such as
> Zvents, do, which is direct user to Google C. account login page,
> wait for user to login, and keep Google C. open in order to save
> the event.  These apps link to Google C. with a url that looks
> like this:  https://www.google.com/accounts/ServiceLogin?service...  I
> have not been able to find any reference to this url in the Google
> Account Authentication API.  Any idea where is it covered in the
> document or this is something else entirely?  Or that I simply need to
> dig deeper into AuthSub to achieve my goal?  I would again appreciate
> any guidance.  Thanks!
This topic is locked and can not be replied to.