From ed97dcd1008e8d4041d22cbe7ba8316bfc1682c2 Mon Sep 17 00:00:00 2001 From: Abidul Wahab Ramadan Date: Thu, 9 Mar 2017 21:26:10 +0800 Subject: [PATCH] adding services that can load GA data #56 --- y2bsearch/app/Http/Controllers/Controller.php | 4 + .../app/Src/GA/GoogleAnalyticsService.php | 130 ++++ y2bsearch/composer.json | 3 +- y2bsearch/composer.lock | 554 +++++++++++++++++- y2bsearch/config/services.php | 14 + .../config/youtubeSearch-90b8ace0b2fe.json | 12 + 6 files changed, 714 insertions(+), 3 deletions(-) create mode 100644 y2bsearch/app/Src/GA/GoogleAnalyticsService.php create mode 100644 y2bsearch/config/youtubeSearch-90b8ace0b2fe.json diff --git a/y2bsearch/app/Http/Controllers/Controller.php b/y2bsearch/app/Http/Controllers/Controller.php index 322d250..723fa94 100644 --- a/y2bsearch/app/Http/Controllers/Controller.php +++ b/y2bsearch/app/Http/Controllers/Controller.php @@ -5,6 +5,10 @@ use App\Src\EsService\EsService; use App\Src\SearchService\SearchProcessor; use App\Src\SubtitleAnalyzer\SubtitleAnalyzer; +use ClassPreloader\Config; +use Exception; +use Google_Client; +use Google_Service_Analytics; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; diff --git a/y2bsearch/app/Src/GA/GoogleAnalyticsService.php b/y2bsearch/app/Src/GA/GoogleAnalyticsService.php new file mode 100644 index 0000000..e1cdf00 --- /dev/null +++ b/y2bsearch/app/Src/GA/GoogleAnalyticsService.php @@ -0,0 +1,130 @@ +initializeAnalytics(); + $profile = $this->getFirstProfileId($analytics); + $results = $this->getResults($analytics, $profile); + $this->printResults($results); + } + + /** + * @return Google_Service_Analytics + */ + public function initializeAnalytics() + { + // Creates and returns the Analytics Reporting service object. + + // Use the developers console and download your service account + // credentials in JSON format. Place them in this directory or + // change the key file location if necessary. + $config = config('services.ga'); + + // Create and configure a new client object. + $client = new Google_Client(); + $client->setApplicationName("SearchYuotubes"); + $client->setAuthConfig($config); + $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); + $analytics = new Google_Service_Analytics($client); + + return $analytics; + } + + /** + * @param $analytics + * + * @return mixed + * @throws Exception + */ + public function getFirstProfileId($analytics) + { + // Get the user's first view (profile) ID. + + // Get the list of accounts for the authorized user. + $accounts = $analytics->management_accounts->listManagementAccounts(); + + if (count($accounts->getItems()) > 0) { + $items = $accounts->getItems(); + $firstAccountId = $items[0]->getId(); + + // Get the list of properties for the authorized user. + $properties = $analytics->management_webproperties + ->listManagementWebproperties($firstAccountId); + + if (count($properties->getItems()) > 0) { + $items = $properties->getItems(); + $firstPropertyId = $items[0]->getId(); + + // Get the list of views (profiles) for the authorized user. + $profiles = $analytics->management_profiles + ->listManagementProfiles($firstAccountId, $firstPropertyId); + + if (count($profiles->getItems()) > 0) { + $items = $profiles->getItems(); + + // Return the first view (profile) ID. + return $items[0]->getId(); + + } else { + throw new Exception('No views (profiles) found for this user.'); + } + } else { + throw new Exception('No properties found for this user.'); + } + } else { + throw new Exception('No accounts found for this user.'); + } + } + + /** + * @param $analytics + * @param $profileId + * + * @return mixed + */ + public function getResults($analytics, $profileId) + { + // Calls the Core Reporting API and queries for the number of sessions + // for the last seven days. + return $analytics->data_ga->get( + 'ga:' . $profileId, + '7daysAgo', + 'today', + 'ga:sessions' + ); + } + + /** + * @param $results + */ + public function printResults($results) + { + // Parses the response from the Core Reporting API and prints + // the profile name and total sessions. + if (count($results->getRows()) > 0) { + + // Get the profile name. + $profileName = $results->getProfileInfo()->getProfileName(); + + // Get the entry for the first entry in the first row. + $rows = $results->getRows(); + $sessions = $rows[0][0]; + + // Print the results. + print "First view (profile) found: $profileName\n"; + print "Total sessions: $sessions\n"; + } else { + print "No results found.\n"; + } + } +} diff --git a/y2bsearch/composer.json b/y2bsearch/composer.json index efbc62f..7dfc31b 100644 --- a/y2bsearch/composer.json +++ b/y2bsearch/composer.json @@ -7,7 +7,8 @@ "require": { "php": ">=5.5.9", "laravel/framework": "5.2.*", - "elasticsearch/elasticsearch": "~5.0" + "elasticsearch/elasticsearch": "~5.0", + "google/apiclient": "^2.0" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/y2bsearch/composer.lock b/y2bsearch/composer.lock index a3dd4dd..b45ac88 100644 --- a/y2bsearch/composer.lock +++ b/y2bsearch/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "05dd81f3f8c21a31eb1acf904afbd014", - "content-hash": "b69485ad81cfd5555b0dfc129bc51c66", + "hash": "51cb41b4c9d6af3507fdaeb03ecd15c1", + "content-hash": "6ad2dc3f8ce3a1ec632f724b2430dc8a", "packages": [ { "name": "classpreloader/classpreloader", @@ -216,6 +216,368 @@ ], "time": "2016-10-26 14:35:32" }, + { + "name": "firebase/php-jwt", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/dccf163dc8ed7ed6a00afc06c51ee5186a428d35", + "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "time": "2016-07-18 04:51:16" + }, + { + "name": "google/apiclient", + "version": "v2.1.2", + "source": { + "type": "git", + "url": "https://github.com/google/google-api-php-client.git", + "reference": "360e656f48c3262a6f7fefc0207521efa66caedf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/google-api-php-client/zipball/360e656f48c3262a6f7fefc0207521efa66caedf", + "reference": "360e656f48c3262a6f7fefc0207521efa66caedf", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "~2.0|~3.0|~4.0", + "google/apiclient-services": "^0.9", + "google/auth": "^0.11", + "guzzlehttp/guzzle": "~5.2|~6.0", + "guzzlehttp/psr7": "^1.2", + "monolog/monolog": "^1.17", + "php": ">=5.4", + "phpseclib/phpseclib": "~0.3.10|~2.0" + }, + "require-dev": { + "cache/filesystem-adapter": "^0.3.2", + "phpunit/phpunit": "~4", + "squizlabs/php_codesniffer": "~2.3", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1" + }, + "suggest": { + "cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Google_": "src/" + }, + "classmap": [ + "src/Google/Service/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "time": "2017-01-11 19:44:46" + }, + { + "name": "google/apiclient-services", + "version": "v0.9", + "source": { + "type": "git", + "url": "https://github.com/google/google-api-php-client-services.git", + "reference": "c400c655d1b7ca412ad4dd344e569c6865e74a83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/c400c655d1b7ca412ad4dd344e569c6865e74a83", + "reference": "c400c655d1b7ca412ad4dd344e569c6865e74a83", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "type": "library", + "autoload": { + "psr-0": { + "Google_Service_": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "time": "2017-01-11 18:53:21" + }, + { + "name": "google/auth", + "version": "v0.11.1", + "source": { + "type": "git", + "url": "https://github.com/google/google-auth-library-php.git", + "reference": "a240674b08a09949fd5597f7590b3ed83663a12d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/google-auth-library-php/zipball/a240674b08a09949fd5597f7590b3ed83663a12d", + "reference": "a240674b08a09949fd5597f7590b3ed83663a12d", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "~2.0|~3.0|~4.0", + "guzzlehttp/guzzle": "~5.3|~6.0", + "guzzlehttp/psr7": "~1.2", + "php": ">=5.4", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^1.11", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ], + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "time": "2016-11-02 14:59:14" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.2.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-02-28 22:50:30" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20 10:07:11" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/0d6c7ca039329247e4f0f8f8f6506810e8248855", + "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-02-27 10:51:17" + }, { "name": "guzzlehttp/ringphp", "version": "1.1.0", @@ -943,6 +1305,194 @@ ], "time": "2016-03-18 20:34:03" }, + { + "name": "phpseclib/phpseclib", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/ab8028c93c03cc8d9c824efa75dc94f1db2369bf", + "reference": "ab8028c93c03cc8d9c824efa75dc94f1db2369bf", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "~4.0", + "sami/sami": "~2.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "time": "2016-10-04 00:57:04" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06 20:24:11" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06 14:39:51" + }, { "name": "psr/log", "version": "1.0.2", diff --git a/y2bsearch/config/services.php b/y2bsearch/config/services.php index 287b118..6050f23 100644 --- a/y2bsearch/config/services.php +++ b/y2bsearch/config/services.php @@ -35,4 +35,18 @@ 'secret' => env('STRIPE_SECRET'), ], + 'ga' => [ + "type" => "service_account", + "project_id" => "youtubesearch-151013", + "private_key_id" => "90b8ace0b2fe774b96b43609b99871593546f6e8", + "private_key" => "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCmHo6jF7OMPBz9\nTbkRe4I9LnN9M+uEXTV27K6DO6kVfQUzXC3DYSl8wj+f1nsJg7xr3kZdFPO5LWdP\nY+QHTm3/2YYEEDU6XY9ZpdGBa46T54QXyz3KMAXbqrVqKFs52CwieBVbOAKB4AH7\nMl/zj+KXaL8hXDHIb1N4glME/2xRpn/DNpDPBfs+oK5+lAl1ZN20pfpowTDeP+aQ\nOk9fBZNrik2g46VI8I81CePxfDSAU7FGPk7tXFyAl+P+/5ebeg+iJ+0TDotVwEBf\nLLdVLK5veMAlk8I3InpWz2DtuyH2TdlrG5T1t2voXNgS2yfqOWXVha7HZ6o2n+tq\nSf4sn97TAgMBAAECggEBAJN3/wHzsXWli8qma8uET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QEnSMqJfMJsfnOQ5FykmZBgQhuy2X/bTdWT4tYdZG/Wk9vBHrZMS6LRgaY\nQxyAdzsXcP6IIiJnYEMLjFFekFbVMwRgwYR+pBpvZmYNmxEoXVIYXh/yo6LLIU6R\ntW0vQGZGbQYBzUZU5XyTwm+X\n-----END PRIVATE KEY-----\n", + "client_email" => "searchyoutubesanalytics@youtubesearch-151013.iam.gserviceaccount.com", + "client_id" => "105473191996490009005", + "auth_uri" => "https://accounts.google.com/o/oauth2/auth", + "token_uri" => "https://accounts.google.com/o/oauth2/token", + "auth_provider_x509_cert_url" => "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url" => "https://www.googleapis.com/robot/v1/metadata/x509/searchyoutubesanalytics%40youtubesearch-151013.iam.gserviceaccount.com", + ], + + ]; diff --git a/y2bsearch/config/youtubeSearch-90b8ace0b2fe.json b/y2bsearch/config/youtubeSearch-90b8ace0b2fe.json new file mode 100644 index 0000000..fc0e28a --- /dev/null +++ b/y2bsearch/config/youtubeSearch-90b8ace0b2fe.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "youtubesearch-151013", + "private_key_id": "90b8ace0b2fe774b96b43609b99871593546f6e8", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCmHo6jF7OMPBz9\nTbkRe4I9LnN9M+uEXTV27K6DO6kVfQUzXC3DYSl8wj+f1nsJg7xr3kZdFPO5LWdP\nY+QHTm3/2YYEEDU6XY9ZpdGBa46T54QXyz3KMAXbqrVqKFs52CwieBVbOAKB4AH7\nMl/zj+KXaL8hXDHIb1N4glME/2xRpn/DNpDPBfs+oK5+lAl1ZN20pfpowTDeP+aQ\nOk9fBZNrik2g46VI8I81CePxfDSAU7FGPk7tXFyAl+P+/5ebeg+iJ+0TDotVwEBf\nLLdVLK5veMAlk8I3InpWz2DtuyH2TdlrG5T1t2voXNgS2yfqOWXVha7HZ6o2n+tq\nSf4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jvOQKBgF9GZs7CJZENb8sqhmcH\nIat4mhQEnSMqJfMJsfnOQ5FykmZBgQhuy2X/bTdWT4tYdZG/Wk9vBHrZMS6LRgaY\nQxyAdzsXcP6IIiJnYEMLjFFekFbVMwRgwYR+pBpvZmYNmxEoXVIYXh/yo6LLIU6R\ntW0vQGZGbQYBzUZU5XyTwm+X\n-----END PRIVATE KEY-----\n", + "client_email": "searchyoutubesanalytics@youtubesearch-151013.iam.gserviceaccount.com", + "client_id": "105473191996490009005", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://accounts.google.com/o/oauth2/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/searchyoutubesanalytics%40youtubesearch-151013.iam.gserviceaccount.com" +}