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'; |
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/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_YouTube($client); | |
try { | |
// Call the channels.list method to retrieve information about the | |
// currently authenticated user's channel. |
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_YouTube($client); | |
try { | |
$keySearch = isset($_POST['key']) ? $_POST['key'] : ''; |
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/Analytics.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 | |
// The first step is the authentication, in an other gist | |
// ... | |
function runDemo($analytics) { | |
try { | |
// Step 2. Get the user's first view (profile) ID. | |
$profileId = getFirstProfileId($analytics); |
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 | |
/** | |
* @file | |
* User has successfully authenticated with Twitter. Access tokens saved to session and DB. | |
*/ | |
/* Load required lib files. */ | |
session_start(); | |
require_once('twitteroauth/twitteroauth.php'); | |
require_once('config.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Twitter - Get tweet infos in PHP</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<style type="text/css"> | |
img {border-width: 0} | |
* {font-family:'Lucida Grande', sans-serif;} | |
</style> |
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 | |
/** | |
* @file | |
* User has successfully authenticated with Twitter. Access tokens saved to session and DB. | |
*/ | |
/* Load required lib files. */ | |
session_start(); | |
require_once('twitteroauth/twitteroauth.php'); | |
require_once('config.php'); |
OlderNewer