Forum Moderators: martinibuster
The script was originally written by Amznvibe I think:
[webmasterworld.com...]
Does anyone have a fix?
I've tried many, many techniques tonight and there simply is no way to request a forwarding URL through the new login.
If anyone knows a passthough for the login, please let me know.
All I can tell is they designed it with a service destination only (mail, adsense, etc) no more url specific forwarding.
I have to study google checkout some more, they might be hiding something in there that I am not fully aware of.
[edited by: amznVibe at 5:04 am (utc) on May 9, 2007]
It's actually why it won't forward.
Well, that and this damn AJAX that everyone seem to insist on using to break everything.
The only way I can think to get around this is to do a much more complex technique of logging in, getting the sessionid, then using that sessionid to make the request. Then the session would have to be closed.
To be honest, while I understand the technique, I've never actually attempted such a complex transaction in curl. It's going to take alot of trial and error.
Of course this also happens when I am particularly busy with other projects.
[edited by: amznVibe at 5:37 am (utc) on May 9, 2007]
Although it updates itself fine, just when you want to look at the account it takes you around the houses, how do I bypass that screen with SysSense?
[1]
$username="your-username";
$password="your-password";
$postdata="Email=".urlencode($username)."&Passwd=%09".urlencode($password)."&service=adsense&ifr=true&rmShown=1&null=Sign+in";
$agent="User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)";
$cookie=dirname(__FILE__)."/cookiefile";
putenv('TZ=US/Pacific'); $randate=mktime(0, 0, 0, date("m"), date("d")-rand(3,26),date("Y"));
[/1][1]
$chain=array(
"https://www.google.com/accounts/ServiceLoginBoxAuth",
"https://www.google.com/accounts/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&service=adsense&hl=en_US&chtml=LoginDoneHtml",
"https://www.google.com/adsense/report/aggregate?sortColumn=0&reverseSort=false&storedReportId=-1&isOldReport=false&product=afc&dateRange.simpleDate=thismonth&dateRange.dateRangeType=custom&dateRange.customDate.start.month="
.date("n",$randate)."&dateRange.customDate.start.day=".date("j",$randate)."&dateRange.customDate.start.year=".date("Y",$randate)."&dateRange.customDate.end.month=".date("n")."&dateRange.customDate.end.day=".date("j")."&dateRange.customDate.end.year=".date("Y")
."&unitPref=page&reportType=property&searchField=&groupByPref=date&csv=true&outputFormat=TSV_EXCEL"
);
[/1][1]
$ch = curl_init();
foreach ($chain as $url)
{
curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_USERAGENT, $agent);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_TIMEOUT, 35);
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);
// echo "<html>".$result;
[/1] [edited by: amznVibe at 8:01 am (utc) on May 9, 2007]
I've got years worth of adsense data in a mysql database, not sure what to do with it all but it's interesting to accumulate.
Has anyone ever figured out how to track clicks in Mozilla browsers? The IE click tracker code still works great but there was never a solution for Firefox, etc.
[edited by: amznVibe at 7:02 pm (utc) on May 16, 2007]