Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function retrieveAllDocuments($gdClient, $html)
- {
- if ($html) {echo "<h2>Your documents</h2>\n";}
- $feed = $gdClient->getDocumentListFeed();
- printDocumentsFeed($feed, $html);
- }
- function printDocumentsFeed($feed, $html)
- {
- if ($html) {echo "<ul>\n";}
- // Iterate over the document entries in the feed and display each document's
- // title.
- foreach ($feed->entries as $entry) {
- if ($html) {
- // Find the URL of the HTML view of the document.
- $alternateLink = '';
- foreach ($entry->link as $link) {
- if ($link->getRel() === 'alternate') {
- $alternateLink = $link->getHref();
- }
- }
- // Make the title link to the document on docs.google.com.
- echo "<li><a href=\"$alternateLink\">\n";
- }
- echo "$entry->title\n";
- if ($html) {echo "</a></li>\n";}
- }
- if ($html) {echo "</ul>\n";}
- }
- set_include_path('ZendGdata-1.11.2/library/');
- require_once('Zend/Loader.php');
- //require_once('ZGdata/Entry.php');
- require_once('Zend/Gdata/ClientLogin.php');
- require_once('Zend/Gdata/Docs.php');
- require_once('Zend/Gdata/Docs/DocumentListEntry.php');
- $user = 'ionut';
- $pass = '';
- $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; // predefined service name for Google Documents
- $httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
- $gdClient = new Zend_Gdata_Docs($httpClient);
- retrieveAllDocuments($gdClient, TRUE);
- $user = 'morion4000';
- $pass = '';
- $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; // predefined service name for Google Documents
- $httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
- $gdClient = new Zend_Gdata_Docs($httpClient);
- retrieveAllDocuments($gdClient, TRUE);
- ?>
Add Comment
Please, Sign In to add comment