This is also happening when I try to Add a photo and/or update a
photo. It is still happening when I try to access my account too..
Here is the full script I use:
-------------------------------
<?php
require_once "Zend/Gdata/Photos.php";
require_once "Zend/Gdata/ClientLogin.php";
require_once "Zend/Gdata/Photos/AlbumQuery.php";
require_once "Zend/Gdata/Photos/PhotoEntry.php";
require_once "Zend/Gdata/Photos/PhotoQuery.php";
set_time_limit(180);
class PicasaFacade extends AbstractFacade {
private $picasa;
// TODO: change this to use either AuthSub or OAuth authentication
tokens so we don't need the user data harcoded
public function __construct($apiAdapter, $tokens = NULL) {
parent::__construct($apiAdapter);
$svc = \Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$user = "[email protected]";
$pass = "xxxx";
//$client = Zend_Gdata_AuthSub::getHttpClient($apiAdapter->);
$client = \Zend_Gdata_ClientLogin::getHttpClient($user, $pass,
$svc);
$client->setConfig(array( 'timeout' => 180 ));
$this->picasa = new \Zend_Gdata_Photos($client);
}
function update_photo($args)
{
$photoQuery = new \Zend_Gdata_Photos_PhotoQuery;
$photoQuery->setUser($args['userid']);
$photoQuery->setAlbumId($args['albumid']);
$photoQuery->setPhotoId($args['photoid']);
$photoQuery->setType('entry');
$entry = $this->picasa->getPhotoEntry($photoQuery);
$uri = $entry->getLink("edit-media")->href;
$entry->setTitle( $this->picasa->newTitle($args['title']) );
$result = $entry->save();
try{
$xml = $result->getXML();
}catch (Exception $e){
echo $e;
exit();
}
return $xml;
}
public function upload_pic($args) {
$fd = $this->picasa->newMediaFileSource($_FILES['Filedata']
['tmp_name']);
$fd->setContentType($_FILES['Filedata']['type']);
$entry = new \Zend_Gdata_Photos_PhotoEntry();
$entry->setMediaSource($fd);
$entry->setTitle($this->picasa->newTitle($args['title']));
$albumQuery = new Zend_Gdata_Photos_AlbumQuery;
$albumQuery->setUser("default");
$albumQuery->setAlbumId($args['albumid']);
$albumEntry = $this->picasa->getAlbumEntry($albumQuery);
try {
$newEntry = $this->picasa->insertPhotoEntry($entry,
$albumEntry);
} catch (\Zend_Gdata_App_HttpException $httpException) {
throw new
\Lvc_Exception($httpException->getRawResponseBody());
} catch (\Zend_Gdata_App_Exception $e) {
throw new \Lvc_Exception($e->getMessage());
}
return $newEntry->getXML();
}
public function delete_photo($args) {
$photoQuery = new Zend_Gdata_Photos_PhotoQuery;
$photoQuery->setUser($args['userid']);
$photoQuery->setAlbumId($args['albumid']);
$photoQuery->setPhotoId($args['photoid']);
$photoQuery->setType('entry');
$entry = $this->picasa->getPhotoEntry($photoQuery);
try {
$result = $entry->delete();
} catch (Exception $e) {
echo "Error: " . $e;
}
return $xml;
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-picasa-data-api?hl=en.