google-api-php-client

Google Cal API - Script to Check Events

感情迁移 提交于 2019-12-31 01:59:05
问题 I want to build a script that will check a Authenticated User's Google Calendar via the Google Calendar PHP Client. I was able to build a simple page that lets a user Auth and give permission to the Calendar Events. I receive a token and then grab a 15 upcoming events via: $googleCal = new Google_Service_Calendar($googleClient); $results = $googleCal->events->listEvents($calendarId, $optParams); But what I'm struggling with is how to save this so I can have a script check this everyday to see

Refreshing Tokens with Google API for Google Calendar v3

让人想犯罪 __ 提交于 2019-12-30 11:22:22
问题 I'm trying to use Google API (PHP) to perform a daily sync between a system calendar and the user's Google Calendars. I want a system user to be able to set up access to their calendar once from within the system, then the system can synchronise the calendars each day via a cron job. I have managed to get the entire process working, from authorising the access to syncing the calendars, but I am getting stuck with the token expiry times. The way I thought it worked in v3 was the old token

A client error occurred: Could not create storage directory: /tmp/Google_Client/00

只愿长相守 提交于 2019-12-30 07:00:07
问题 What does this error mean with the Youtube API v3.0: A client error occurred: Could not create storage directory: /tmp/Google_Client/00 I am using the PHP Youtube API on Google's documentation found here. 回答1: I solved this problem without changing any line of Google API. In your php code, you juste need to specify where you want the cache folder to be: $config = new Google_Config(); $config->setClassConfig('Google_Cache_File', array('directory' => '../tmp/cache')); // Here I set a relative

Google OAuth 2.0 refresh token for web application with public access

梦想的初衷 提交于 2019-12-30 03:23:05
问题 I'm getting the following error: The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved I have a web application which only my server will be accessing, the initial auth works fine, but after an hour, the aforementioned error message pops up. My script looks like this: require_once 'Google/Client.php'; require_once 'Google/Service/Analytics.php'; session_start(); $client = new Google_Client(); $client

Google API autoload.php missing

纵饮孤独 提交于 2019-12-29 08:54:35
问题 I never used the Goodle API before, and now I try to get my feet wet accessing Google calendar via the API. I downloaded the google-api-php-client-master.zip, extracted the .../src/Google directory and copied it to my webserver (hosted by a 3rd party, which means I can't install anything). According to the samples my code needs to start with <?php require_once "Google/Client.php"; require_once "Google/Service/Calendar.php"; .... but the Client.php throws an error: Fatal error: require_once():

Implementing Oauth2 login, Fatal error: Class 'Google_Service' not found

谁说胖子不能爱 提交于 2019-12-28 06:13:49
问题 I am updating my website's login system from LightOpenID to Google's Oauth 2.0. When I require the Client.php and the Service/Oauth2.php I get an error Fatal error: Class 'Google_Service' not found in /home/myname/repos/website_current/lib/google-api-php-client/src/Google/Service/Oauth2.php on line 32 The code I am using (from my login.php file) looks like this require_once(dirname($_SERVER['DOCUMENT_ROOT']).'/lib/autoload.php'); require('Google/Client.php'); require('Google/Service/Oauth2

Google Analytics API - Get page view information for specific URLs

左心房为你撑大大i 提交于 2019-12-28 03:18:09
问题 I am looking to implement a page view tracking system on one of my websites. The website is a directory where suppliers can advertise their services. Suppliers have a unique profile page on the site, e.g mysite.com/directory/abc-profile.html The idea is that suppliers can log in to their account area on the site and view stats on how many people are visiting their profile. Ideally I want to display this as : Total views | Total today | This week | This month | This year It does not matter if

Android google cloud messaging

点点圈 提交于 2019-12-25 12:24:32
问题 i try to send message from my server to google cloud server, but i have problem with it... i get server key(Key for server applications), set it to this code: $headers = array( 'Authorization: key=' .My server key, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl

Android google cloud messaging

会有一股神秘感。 提交于 2019-12-25 12:23:08
问题 i try to send message from my server to google cloud server, but i have problem with it... i get server key(Key for server applications), set it to this code: $headers = array( 'Authorization: key=' .My server key, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl

Android google cloud messaging

↘锁芯ラ 提交于 2019-12-25 12:23:03
问题 i try to send message from my server to google cloud server, but i have problem with it... i get server key(Key for server applications), set it to this code: $headers = array( 'Authorization: key=' .My server key, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl