How to display message list from youtube inbox?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to display message list from youtube inbox?

gerritku
I need display message from youtube inbox.
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