Based on PHP AdSense account monitor class
PHP AdSense Account Library is a class that can retrieve various data from an AdSense account.
require_once('adsense.php'); $username = 'rogerio.albandes@gmail.com'; $password = ''; $adsense = new AdSense(); if ($adsense->connect($username, $password)) { var_dump($adsense->today()); } else { die('Could not login to AdSense account.'); };
Connects to AdSense account using supplied credentials. Returns true on unsuccessful connection, false otherwise.
Log out from adsense. Useful when getting data from two or more accounts.
Gets AdSense data for the period: today. Returns associative array with collected data
Gets AdSense data for the period: yesterday. Returns associative array with collected data
Gets AdSense data for the period: last7days. Returns associative array with collected data
Gets AdSense data for the period: lastmonth. Returns associative array with collected data
Gets AdSense data for the period: thismonth. Returns associative array with collected data
Gets AdSense data for the period: sincelastpayment. Returns associative array with collected data
Get current report id by report name. Helps to avoid problems with report editing and ids.
Get csv data from custom report.
Warning: if you will edit report at Google Adsense page, its id will change!
Get report data as array. Uses html parser. A bit slower than get_report_as_csv().
Warning: if you will edit report at Google Adsense page, its id will change!
© 2009, Alex Polski, Alexander Makarov