Programmatically logging in and using Google services that do not support api

Google provides an API for a number of its services and bindings for several languages. However, not everything is supported. So this question comes from my incomplete understanding of things like wget, curl and various web programming libraries.

  • How can I programmatically authenticate with Google?

  • Can I use existing APIs to access unsupported parts of Google?

Once I authenticate, how can I use this to access my restricted pages? It looks like you can use the API to log in and get a token, but I donโ€™t understand what I have to do next to get a limited web page.

In particular, I play with Android and I want to write a script to capture the usage statistics of my application with the Android Market once or twice a day, so I can make pretty diagrams. My goal is likely to be python, but any language code illustrating the use of non-API Google services will be useful. Thanks guys.

+4
source share
3 answers

You can get auth tokens by authenticating a specific service from https://www.google.com/accounts/ClientLogin

eg.

curl -d "Email=youremail" -d "Passwd=yourpassword" -d "service=blogger" "https://www.google.com/accounts/ClientLogin" 

Then you can simply pass auth tokens and cookies when accessing the service. You can use the firebug plugin or temper data firefox to find out the parameter names, etc.

+1
source

You can use something like mechanization or even urllib to achieve this kind of thing. As a tutorial, you can check out my article here on the programmatic presentation of the form. After authentication, you can use a cookie to access restricted pages.

+1
source

CLientLogin is now deprecated: https://developers.google.com/accounts/docs/AuthForInstalledApps

How can we programmatically authenticate Google using OAuth2?

I can not find an example request with a user and password parameter, as in CLientLogin :(

is there a solution?

0
source

All Articles