Our main goal is to upload audio references to match and automatically claim videos in Youtube. We work ok PHP.
We’re following this example:
[Uploading a new reference, so YouTube can automatically generate claims for newly uploaded videos on behalf of the asset's owner]
https://developers.google.com/youtube/partner/code_samples/php#uploading_a_new_reference__so_youtube_can_automatically_generate_claims_for_newly_uploaded_videos_on_behalf_of_the_asset_s_owner
(second half of the doc):
// Call set_include_path() as needed to point to your client library.
require_once 'Google/Client.php';
require_once 'Google/Service/YouTube.php';
require_once 'Google/Service/YouTubePartner.php'; // <--- This file doesn't exist!
session_start();
We got it through the old API (Google API PHP Client 0.6.7) and the "Google_YouTubePartnerService.php" file we found here: https://developers.google.com/youtube/partner/client_libraries , but this isn’t useful because we need "Service account" authentication, and the API doesn’t work with this.
So, we tried with Google API PHP Client 1.0.0 unsuccessfully. We get the authentication but we need to find this file Google/Service/YouTubePartner.php called by the example on the URL mentioned above: https://developers.google.com/youtube/partner/code_samples/php#uploading_a_new_reference__so_youtube_can_automatically_generate_claims_for_newly_uploaded_videos_on_behalf_of_the_asset_s_owner
Thanks for your help!
Looks like Content ID PHP library wasn't updated for 1.0 version on the site.
Just got it updated. Thanks for the warning. https://developers.google.com/youtube/partner/clientlib/Google-youtubePartner-v1-20140110-php-1.0.0-alpha.zip
Related
I have code which works above the php 5
its actually GA Library, here is its github project.
I have cloned the project theiconic/php-ga-measurement-protocol
Since I am new to PHP, I have no idea where to put this code, Please help me here this project should be installed via composer via code
{
"require": {
"theiconic/php-ga-measurement-protocol": "^2.0"
}
}
After this step I need to create a file something.php and I need to put the code below, I am having problem on locating autoload.php on my server, Please look at the code below to understand what i am saying.
<?php
//grab the data that Calendly sent in the webhook and store it in a variable called $objCalendlySubmission...
$objCalendlySubmission = json_decode(file_get_contents('php://input'));
//We've passed the Google client_id in Calendly's placeholder for utm_term. Feel free to pass it differently, this is just an example
if(property_exists($objCalendlySubmission->payload->tracking, 'utm_term') && !empty($objCalendlySubmission->payload->tracking->utm_term)) {
$strPageViewed = 'calendly_conversion.html'; // We use different page names depending on what type of event was scheduled via Calendly
sendGoogleAnalyticsPageView($objCalendlySubmission->payload->tracking->utm_term, $strPageViewed);
}
function sendGoogleAnalyticsPageView($strGAClientId, $strURL) {
require_once '/path_to_composer/composer/vendor/autoload.php'; //loads the PHP library for the "Google Analytics Measurement Protocol” **I dont know where is it located exactly on my xampp server, Please guide me here**
$analytics = new TheIconic\Tracking\GoogleAnalytics\Analytics(true); //you may have to adjust this path based on your setup **please help me here**
$analytics
->setProtocolVersion('1')
->setTrackingId('YOUR-GA-UA-ID-GOES-HERE')
->setClientId($strGAClientId)
->setDocumentLocationUrl($strURL);
$analytics->sendPageview();
}
?>
In the above code towards middle line
require_once '/path_to_composer/composer/vendor/autoload.php'; //loads the PHP library for the "Google Analytics Measurement Protocol”
I dont know where is it located exactly on my xampp server, Please guide me here
$analytics = new TheIconic\Tracking\GoogleAnalytics\Analytics(true); //you may have to adjust this path based on your setup
Here is the image of Project folder
Project structure Part 2
I'm trying to use the google API as long as some other API but it seems that there is no way to make it work.
I get the error message
Fatal error: Class 'Google_Service' not found in /home/msc/www/wp-content/plugins/wp-posts/lib/Google/Service/YouTube.php on line 32
The whole site is under wordpress 4,1,1
thanks in advance.
The answer was simple enough
I added
require_once 'Google/autoload.php';
based on this topic :
Link here
You need to set an include path that points to where the /Google folder is
set_include_path('C:/path/to');
Is there a simple way to set up a PHP script to accept text using GET and return a QR_CODE?
So the image will be accessed like <img src="script.php?text="ABCDEFG" />
The library at phpqrcode.sourceforge.net didn't work for me, and Google's API isn't a long-term solution.
A quicksearch learnes us the following: http://phpqrcode.sourceforge.net/
You could be using this:
Step 1 . download the phpqrcode library and put it in a folder on your server
Step 2. Use the following script:
if (!isset($_GET['text'])) die('No text given');
include('../lib/full/qrlib.php');
include('config.php');
QRcode::png($_GET['text']);
Step 3. Save it and enjoy it!
I'm trying to read a Doc from Google with an authorized user and output the content through my page.
Everything works fine, and the output is Ok, but after few seconds, a popup window appears with an error "Google Docs has encountered an error. We are looking into the problem now. Please try one of these interim solutions: Reload this page"
My code is this:
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_Docs');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Gdata_Docs_Query');
$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client_grabmark = Zend_Gdata_ClientLogin::getHttpClient('MYUSER#gmail.com', 'MYPASS', $service);
$service = new Zend_Gdata_Docs($client_grabmark);
$service->setMajorProtocolVersion(3);
$contentLink = 'https://docs.google.com/document/d/'DOCID'/edit';
$data = $service->get($contentLink)->getBody();
ob_start();
echo $data;
ob_flush();
exit
?>
What I'm doing wrong? If I try export to PDF everything is Ok (I just have to change the link), but I want to show the page as if I was in Google Docs.
Any help?
Best Regards
DF
You cannot output the HTML content of a Google Doc page into the context of your own page and get that to work. If you want to show a document to a user, redirect them to the Google Doc itself, using an HTTP Location header.
<?php
header("Location: $contentLink");
?>
If the user you had intended to display the doc to does not have permission to access the doc, there are two options:
Share the doc to the user using the Documents List API.
Export the document as text, HTML, or PDF using the API, and then display it to the user.
These options are detailed in the documentation.
I'm getting the following using the PHP client on my server (connecting via FBML). I've included the appropriate php files (facebook etc..)
Fatal error:
Call to undefined method FacebookRestClient::feed_publishUserAction()
in ..../index.php on line 50
I'm trying to use the example given.
Any ideas?
You might want to take a quick browse/grep through your Facebook API files (facebookapi_php5_restlib.php) and make sure that the feed_publishUserAction() method exists. Perhaps you're using an older version of the API library?
OMG I found the answer
Because the facebookapi_php5_restlib.php that facebook.com provided you is a piece of outdated shit
i.e. you won't be able to find the word feed_publishUserAction in the facebookapi_php5_restlib.php file
HOWEVER, the official facebook smiley demo from this facebook wiki page , contained a more completed facebookapi_php5_restlib.php , along with the feed_publishUserAction function
Which finger would you like to show to the facebook developer staffs?