This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to authenticate with OAuth2 by the Google API client | |
**/ | |
$classLoader = require __DIR__.'/../vendor/autoload.php'; | |
require_once __DIR__.'/../vendor/google/apiclient/src/Google/Client.php'; | |
require_once __DIR__.'/../vendor/google/apiclient/src/Google/Service/YouTube.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
if ($client->getAccessToken()) { | |
// Create analytics service object. | |
$youtube = new Google_Service_YouTubeAnalytics($client); | |
try { | |
// Here we query the API | |
$analyticsResponse = $youtube->reports->query('channel==UCKVMqeVtKOKxIIqPX84_MKA', '2014-06-25', '2014-06-29', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to authenticate with OAuth2 by the Google API client | |
**/ | |
$classLoader = require __DIR__.'/../vendor/autoload.php'; | |
require_once __DIR__.'/../vendor/google/apiclient/src/Google/Client.php'; | |
require_once __DIR__.'/../vendor/google/apiclient/src/Google/Service/YouTubeAnalytics.php'; |
NewerOlder