<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Listing album contents</title>
    <style>
    body {
      font-family: Verdana;      
    }
    h2 {
      color: red; 
      text-decoration: none;  
    }
    span.attr {
      font-weight: bolder;  
    }
    img {
      float: left;  
    }
    </style>    
  </head>
  <body>
    <?php
    // load library
    require_once 'Zend/Loader.php';
	Zend_Loader::loadClass('Zend_Gdata');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    Zend_Loader::loadClass('Zend_Gdata_Photos');
    Zend_Loader::loadClass('Zend_Http_Client');
    
    // create authenticated HTTP client for Picasa service
    $svc = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
    $user = "franciscovfoto@gmail.com";
    $pass = "1520alves";
    $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $svc);
    $gphoto = new Zend_Gdata_Photos($client);
    




$next = getCurrentUrl(); 
    $scope = 'https://picasaweb.google.com/data';
    $secure = false;
    $session = true;
    Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure,
        $session);



    // generate query to get album feed
    $query = $gphoto->newAlbumQuery();    
    $query->setUser($user);
    $query->setAlbumName('matheuslinalbx9');
    
//$userFeed = $gphoto->getUserFeed("default");
 //   foreach ($userFeed as $userEntry) {
  //      echo $userEntry->title->text . "<br />\n";
  //  }
 
$tt = @file_get_contents("http://picasaweb.google.com/data/feed/api/user/116323328187579179872/album/matheuslinalbx9?authkey=Gv1sRgCPulk9S-pJaAiAE");

	$xml = simplexml_load_string($tt);
	
			$media = $xml->{"entry"}[1];
			echo $media->{"content"}[0]->attributes()->src;
	
		 

//	print_r($xml);


echo 'francisco';  
  
    // get and parse album feed
    // get album name and number of photos
    try {
      $feed = $gphoto->getAlbumFeed($query);
    } catch (Zend_Gdata_App_Exception $e) {
      echo "Error: " . $e->getResponse();
    }
    ?>
    <h1><?php echo $feed->getTitle(); ?></h1>
    <?php echo $feed->getTotalResults(); ?> photo(s) found.
    <p/>

    <?php        
    // process each photo entry
    // print each entry's title, size, dimensions, tags, and thumbnail image
    foreach ($feed as $entry) {
      $title = $entry->getTitle();
      $summary = $entry->getSummary();
      $thumbnail = $entry->getMediaGroup()->getThumbnail();
      $tags = $entry->getMediaGroup()->getKeywords();
      $size = $entry->getGphotoSize();
      $height = $entry->getGphotoHeight();
      $width = $entry->getGphotoWidth();
      echo $thumbnail[1]->url;
      echo "<h2>$summary</h2>\n";
      echo "<table><tr><td><img src=\"" . 
      $thumbnail[1]->url . "\"/></td>\n";
      echo "<td><span class=\"attr\">File</span>: $title 
      <br />\n";
      echo "<span class=\"attr\">Size</span>: $size bytes 
      ($height x $width) <br />\n";
      echo "<span class=\"attr\">Tags</span>: $tags 
      </td></tr></table>\n";
    }
    ?>

  </body>
</html>