I've found these old posts from 2003 about how to automatically log in to AdSense, and get right to the page you are looking at. I guess Google changed their login code to keep so many people from doing insecure GETs to log in, because it doesn't work anymore. Here is what people used to say: Just type the following into your browser: https://www.google.com/adsense/login.do?username=USER&password=PASS This doesn't work anymore. The login.do page I think is still the same, but their form variables show the username form to now be called "Email" and the password form is called "Passwd". However, substituting those into the URL doesn't work either. I'm not planning on logging in using GETs. I'm actually trying to write something so I can set an hourly job to log into my adsense account (using POSTs with Net::HTTP in ruby), and then dumping my stats into a database. Does anyone know how I can do this these days? Thanks, -Fortytwo
Why dont you try a firefox addon which displays the adsense earnings. On a click on this adsense ticker, you get logged in automatically.
Yeah, I use that plugin too, but thats not really why I need to do this. I'm trying to auto-import my stats so I can programmatically aggregate the stats and see them different ways. Anyway, I found some code snippets... The code is in PHP, and I found it here: http://www.webmasterworld.com/forum89/5349.htm The two snippets listed in that thread are a little out of date, but it should be pretty easy to port to whatever language. It looks like what I was really missing was some sort of cookie handling. I guess Google boots you back out if you don't accept and retain their cookie or something. The scripts they feature in the forum post listed above are for setting up a cron job to automatically SMS or email you periodically with your AdSense stats. Here is a very slightly modified version of the script that worked for me... <? $username="uername@email.com"; $password="pass"; $cookie="/mywebsite.com/adsense/cookiefile"; $log="/mywebsite.com/adsense/adsense.log.txt"; $destination="/adsense/report/aggregate"; $postdata="destination=".urlencode($destination)."&username=".urlencode($username)."&password=".urlencode($password)."&null=Login"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,"https://www.google.com/adsense/login.do"); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt ($ch, CURLOPT_TIMEOUT, 20); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt ($ch, CURLOPT_POST, 1); $result = curl_exec ($ch); curl_close($ch); preg_match('/\<tr class\="totals"\>.*\<td.*\>.*\<\/td\>.*\<td.*\>(.*)\<\/td\>.*\<td.*\>(.*)\<\/td\>.*\<td.*\>(.*)\<\/td\>.*\<td.*\>(.*)\<\/td\>.*\<td.*\>(.*)\<\/td\>.*<\/tr>/simU', $result, $array); foreach ($array as $key => $value) {$array[$key] = trim($value, "\x22\x27\n\r ");} // strip $ % , here if desired list($full,$Impressions,$Clicks,$Rate,$CPM,$Earnings) = $array; putenv('TZ=US/Pacific'); // match Google time no matter where you or your serverlive $output=date("Y-m-d H:i:s")." \t Impressions: ".$Impressions." \t Clicks: ".$Clicks." \t Rate: ".$Rate." \t CPM: ".$CPM." \t Earnings: ".$Earnings."\r\n"; if ($handle = fopen($log, 'a')) {fwrite($handle, $output); fclose($handle);} else {echo "error writing";} //mail("5555555555@mobile.att.net", "Adsense report", $output, "From: Adsense"); mail("myemail@email.com", "Adsense report", $output, "From: Adsense"); ?> PHP: Hope that helps anyone else out there looking for a solution to this problem.
I just use a bookmark of https://www.google.com/adsense/report/overview and it automatically logs me in without doing anything special.
Best option is to use the FireFox Plugin and then right click on that Plugin icon to auto login to your adsense account.
Sysense, also auto logs you in by creating a temporary page which has javascript to auto log you in. Install sysense, right click the icon > open adsense account > click the account. - Auto logs in Edit: I also read somewhere, google don't mind programmes into your account as long they don't do it more than every 15mins and it doesn't break the TOS in any other way.
A month or so back I asked G about this. They said they don't have a preference for the time interval between checks.