i use reference :
http://code.google.com/intl/en/apis/youtube/2.0/developers_guide_php.html#Messages
example code :
<?php
session_start();
require_once 'Zend/Loader.php';
//$yt = new Zend_Gdata_YouTube();
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
//
//
$authenticationURL=
'http://gdata.youtube.com/feeds/api/users/username/inbox';
$httpClient =
Zend_Gdata_ClientLogin::getHttpClient(
$username = 'gerrit.xxxx@gmail.com',
$password = 'g*****8',
$service = 'youtube',
$client = null,
$source = 'MySource', // a short string identifying your
application
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$developerKey =
'AI39si7M1Zu4pkIfBMHr4GIcmJnSbs1w15jacSIGoMrJ6WHk73N-95fP6Zr0Q81xQkzcvzMNQI7ZdeXr7RC9eUHDfvAXXy4NWw';
$applicationId = 'GTube';
$clientId = 'ytapi-GerritBagus-GTube-noj0ps6b-0';
//
$inboxFeed = $yt->getInboxFeedForCurrentUser();
foreach($inboxFeed as $inboxEntry) {
echo "Message title: " . $inboxEntry->getTitle()->text . "\n";
$authors = $inboxEntry->getAuthor();
$author = $authors[0];
echo "Sent from: " . $author->name->text . "\n";
// See if there was a custom message body sent:
$body = $inboxEntry->getSummary();
if ($body != null) {
echo "Message body: " . $body->text . "\n";
}
?>
Anyone can modify this script to make my code working to display message?
Gerrit
--
View this message in context: http://www.nabble.com/How-to-display-message-list-from-youtube-inbox--tp23827735p23827735.html
Sent from the Zend gdata mailing list archive at Nabble.com.
没有评论:
发表评论