我有这个代码工作多年,我曾经检索谷歌分析数据
$ga_email = 'my@gmail.com';
$ga_password = 'myp@ss';
$ga_profile_id = '40871339';
$ga_url = urldecode($_GET['url']);
$ga_id = urldecode($_GET['id']);
$ga_start = substr(urldecode($_GET['fecha']),0, 10);
$ajustado = false;
$customRange = 'date';
if( date("Y-m-d", strtotime($ga_start)) < date("Y-m-d", strtotime("2013-09-10") )){
$ajustado = true;
$ga_start = '2013-09-10';
}
/*
if ( date("Y-m-d", strtotime($ga_start)) < date("Y-m-d", strtotime("-100 day", time()))){
$customRange = 'week';
}
*/
if($ga_url == '')
$ga_url = '/';
/* Create a new Google Analytics request and pull the results */
try {
$ga = new gapi($ga_email,$ga_password);
} catch (Exception $e) {
echo '<h2 style="margin-top: 50px; color: #922">Hubo un error inesperado. Por favor, intentalo más tarde..</h2>';
die();
}
但我意识到现在抛出一个致命的错误
Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed to authenticate user. Error: "https://developers.google.com/accounts/docs/AuthForInstalledApps "' in /var/www/html/gapi.class.php:419 Stack trace: #0 /var/www/html/gapi.class.php(63): gapi->authenticateUser('my@gmail.c...', 'myp@a..') #1 /var/www/html/includes/gareport.php(93): gapi->__construct('my@gmail.c...', 'myp@a..') #2 {main} thrown in /var/www/html/gapi.class.php on line 419
这是一个正确的电子邮件/密码,
这停止了吗?