I've been trying to figure out how to download my Adsense data report for days using the Google code... and I couldn't figure it out, especially with their confusing different naming conventions for codes/keys between the documentation and their actual console.
This morning, with the help of your great library, I was able to not only access my Google Adsense data but to generate the perfectly formatted report for my needs (thanks on Google API Explorer that helped a lot for the return structure).
I was able to complete that within 2 hours (including the reading initial part).
Now, I'll take about another hour to create my MySQL tables and dump the data... and I'll have it run nightly through CRON to have my own customized reporting.
Sylvain Beauregard - 2012-11-22 23:25:18 - In reply to message 2 from Manuel Lemos
All the script is complete now. But I have an issue when it comes to execute it from the UNIX Command-line. It doesn't generate any error but the communication stops of course when Google tries to reconnect with the script. No data has been processed.
I've tried with Lynx... but it doesn't want to process either. I'll look into other possible browsers available.
Unless you have any other idea?
Normally, the solution would be use a Service Account API Key... but Adsense doesn't support those API keys apparently.
Manuel Lemos - 2012-11-23 01:11:44 - In reply to message 3 from Sylvain Beauregard
After the user has authorized the API access, you can store the access_token value and use it even when the user is not online to call the API. Just set the access_token class variable from the stored value.
In that case you no longer have to call the Process function, as that is used only to redirect the user to Google site to ask for permission again.