List Info

Thread: Re: Get Picassa Web Albums ?




Re: Get Picassa Web Albums ?
user name
2007-09-19 09:35:20
Hi,

Just to say that I have finished my Web application using
Zend Gdata and
Picasa Web API.
You can find it here  http://www.musiic.net/p
icasa/
http://www.musiic.net/p
icasa/ .

AddToPicasa allows you to add any online image to Picasa Web
Albums:

    * Connect to Picasa Web with your Google account and you
will be ready
to add photos and images.
    * Give the image location (image URL address) and an
optional caption.
    * Select one existing Picasa Web album (public or
private).
    * Add your image to the selected album.

You can also use AddToPicasa as a Firefox Extension:
After installing the extension, an item "Add to Picasa
Web Albums" is added
into the Firefox context menu.
Right click on the image you want to add into Picasa Web,
choose "Add to
Picasa Web Albums".
A window shows up with the desired image, connect to your
Picasa Web account
and press submit button to add the image.

Simple !

Victor



victorc wrote:
> 
> Hi,
> 
> Thanks very much for this quick answer :jumping:
> There was an error in my code, I was using the
setMaxResults properties on
> the query :
> $query = new Zend_Gdata_Query('http://picasaw......'); 
> $query->setMaxResults(10);
> $feed = $gdata->getFeed($query);
> 
> And thanks for your code and info about the PWA support
roadmap.
> :drunk:
> Victor
> 
> 
> 
> Ryan Boyd-3 wrote:
>> 
>> Hi Victor,
>> 
>> You should be able to retrieve a feed from the
Picasa Web Albums data API
>> using this component, although it's not as
convenient as it would be if
>> there was a Picasa Web Albums data API extension
(as there is for
>> Calendar,
>> Spreadsheets, Provisioning, etc)
>> 
>> Here's some example code to print the titles of
each album:
>> ----------------
>> <?php
>> require_once 'Zend/Loader.php';
>> Zend_Loader::loadClass('Zend_Gdata');
>> 
>> $gdClient = new Zend_Gdata();
>> $feed = $gdClient->getFeed('
>> http://picasaweb.google.com/data/feed/api/user/victor.cou
stenoble?start-index=1&max-results=1000&kind=album'
>> );
>> foreach ($feed as $entry) {
>>   echo $entry->title . "n";
>> }
>> ?>
>> --------------
>> 
>> The titles are readily available because titles are
part of a standard
>> Atom
>> feed.  Because there is not yet an extension
specifically created for
>> Picasa
>> Web Albums, Zend_Gdata doesn't know about many of
the PWA-specific or
>> Media
>> RSS-specific elements.  You still can access this
data via the Extension
>> Elements, however:
>> 
>> Here's some rudimentary code that places the
extension elements into an
>> array for easier read-only access:
>> ---------
>> foreach ($feed as $entry) {
>>   foreach ($entry->extensionElements as
$element) {
>>     if (sizeof($element->extensionElements) ==
0) {
>>       $extensions[$element->rootElement] =
$element->text;
>>     } else if ($element->rootNamespaceURI ==
>> 'http://search.yahoo.com
/mrss/'
>>         &&  $element->rootElement ==
'group') {
>>       foreach ($element->extensionElements as
$mediaElement) {
>>         $mediaArrayItem['text'] =
$mediaElement->text;
>>         foreach
($mediaElement->extensionAttributes as $attribute) {
>>           $mediaArrayItem[$attribute['name']] =
$attribute['value'];
>>         }
>>         $mediaGroup[$mediaElement->rootElement]
= $mediaArrayItem;
>>       }
>>     }
>>   }
>>   echo $entry->title . "n";
>>   print_r($extensions);
>>   print_r($mediaGroup)
>> }
>> ------
>> 
>> Note that none of this code comes with any
guarantees 
>> 
>> We are working on the PWA data API extension for
the Zend_Gdata
>> component.
>> It's filed in Jira as ZF-1616:
>> http:
//framework.zend.com/issues/browse/ZF-1616
>> 
>> Hope this helps,
>> -Ryan
>> 
>> On 8/10/07, victorc <victor.coustenoblegmail.com> wrote:
>>>
>>>
>>> Hi,
>>>
>>> I try to retrieve Picassa Web album info, is
someone already did that ?
>>>
>>> I have successfully get all posts from a
blogger blog but when I ask
>>> albums
>>> list from a Picassa Web account with the feed
url like
>>>
>>> http://picasaweb.google.com/data/feed/api/user/victor.cou
stenoble?start-index=1&max-results=1000&kind=album
>>> for example, then I have the error message
"Expected response code 200,
>>> got
>>> 400"  in following errors :
>>>
>>> Fatal error: Uncaught exception
'Zend_Gdata_App_HttpException' with
>>> message
>>> 'Expected response code 200, got 400' in
>>> /home/wb59649/picassa/Zend/Gdata/App.php:282
Stack trace: #0
>>> /home/wb59649/picassa/Zend/Gdata/App.php(126):
>>> Zend_Gdata_App::import('http://picasawe...',
Object(Zend_Http_Client),
>>> 'Zend_Gdata_Feed') #1
/home/wb59649/picassa/Zend/Gdata.php(109):
>>> Zend_Gdata_App->getFeed('http://picasawe...',
'Zend_Gdata_Feed') #2
>>> /home/wb59649/picassa/getalbumlist.php5(47):
>>>
Zend_Gdata->getFeed(Object(Zend_Gdata_Query)) #3 
thrown in
>>> /home/wb59649/picassa/Zend/Gdata/App.php on
line 282
>>>
>>> Any ideas ? 
>>>
>>> Thank you
>>> Victor
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Get-Picassa-W
eb-Albums---tf4249038s16154.html#a12092343
>>> Sent from the Zend gdata mailing list archive
at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Get-Picassa-W
eb-Albums---tf4249038s16154.html#a12778773
Sent from the Zend gdata mailing list archive at
Nabble.com.


RE: Get Picassa Web Albums ?
user name
2007-09-19 10:00:15
Nice work Victor, looks great!

Kind Regards,

Mike Pearce 
Senior Developer | Jellyfish

01737 232245 
mike.pearcejellyfish.co.uk
-----------------------------------
Search Engine Marketing Specialists


> -----Original Message-----
> From: victorc [mailto:victor.coustenoblegmail.com]
> Sent: 19 September 2007 15:35
> To: fw-gdatalists.zend.com
> Subject: Re: [fw-gdata] Get Picassa Web Albums ?
> 
> 
> Hi,
> 
> Just to say that I have finished my Web application
using Zend Gdata
> and
> Picasa Web API.
> You can find it here  http://www.musiic.net/p
icasa/
> http://www.musiic.net/p
icasa/ .
> 
> AddToPicasa allows you to add any online image to
Picasa Web Albums:
> 
>     * Connect to Picasa Web with your Google account
and you will be
> ready
> to add photos and images.
>     * Give the image location (image URL address) and
an optional
> caption.
>     * Select one existing Picasa Web album (public or
private).
>     * Add your image to the selected album.
> 
> You can also use AddToPicasa as a Firefox Extension:
> After installing the extension, an item "Add to
Picasa Web Albums" is
> added
> into the Firefox context menu.
> Right click on the image you want to add into Picasa
Web, choose "Add
> to
> Picasa Web Albums".
> A window shows up with the desired image, connect to
your Picasa Web
> account
> and press submit button to add the image.
> 
> Simple !
> 
> Victor
> 
> 
> 
> victorc wrote:
> >
> > Hi,
> >
> > Thanks very much for this quick answer :jumping:
> > There was an error in my code, I was using the
setMaxResults
> properties on
> > the query :
> > $query = new Zend_Gdata_Query('http://picasaw......');
> > $query->setMaxResults(10);
> > $feed = $gdata->getFeed($query);
> >
> > And thanks for your code and info about the PWA
support roadmap.
> > :drunk:
> > Victor
> >
> >
> >
> > Ryan Boyd-3 wrote:
> >>
> >> Hi Victor,
> >>
> >> You should be able to retrieve a feed from the
Picasa Web Albums
> data API
> >> using this component, although it's not as
convenient as it would
be
> if
> >> there was a Picasa Web Albums data API
extension (as there is for
> >> Calendar,
> >> Spreadsheets, Provisioning, etc)
> >>
> >> Here's some example code to print the titles
of each album:
> >> ----------------
> >> <?php
> >> require_once 'Zend/Loader.php';
> >> Zend_Loader::loadClass('Zend_Gdata');
> >>
> >> $gdClient = new Zend_Gdata();
> >> $feed = $gdClient->getFeed('
> >>
>
http://picasaweb.google.com/data/feed/api
/user/victor.coustenoble?start
> -index=1&max-results=1000&kind=album'
> >> );
> >> foreach ($feed as $entry) {
> >>   echo $entry->title . "n";
> >> }
> >> ?>
> >> --------------
> >>
> >> The titles are readily available because
titles are part of a
> standard
> >> Atom
> >> feed.  Because there is not yet an extension
specifically created
> for
> >> Picasa
> >> Web Albums, Zend_Gdata doesn't know about many
of the PWA-specific
> or
> >> Media
> >> RSS-specific elements.  You still can access
this data via the
> Extension
> >> Elements, however:
> >>
> >> Here's some rudimentary code that places the
extension elements
into
> an
> >> array for easier read-only access:
> >> ---------
> >> foreach ($feed as $entry) {
> >>   foreach ($entry->extensionElements as
$element) {
> >>     if (sizeof($element->extensionElements)
== 0) {
> >>       $extensions[$element->rootElement] =
$element->text;
> >>     } else if ($element->rootNamespaceURI
==
> >> 'http://search.yahoo.com
/mrss/'
> >>         &&  $element->rootElement
== 'group') {
> >>       foreach ($element->extensionElements
as $mediaElement) {
> >>         $mediaArrayItem['text'] =
$mediaElement->text;
> >>         foreach
($mediaElement->extensionAttributes as $attribute)
{
> >>           $mediaArrayItem[$attribute['name']]
=
$attribute['value'];
> >>         }
> >>        
$mediaGroup[$mediaElement->rootElement] =
$mediaArrayItem;
> >>       }
> >>     }
> >>   }
> >>   echo $entry->title . "n";
> >>   print_r($extensions);
> >>   print_r($mediaGroup)
> >> }
> >> ------
> >>
> >> Note that none of this code comes with any
guarantees 
> >>
> >> We are working on the PWA data API extension
for the Zend_Gdata
> >> component.
> >> It's filed in Jira as ZF-1616:
> >> http:
//framework.zend.com/issues/browse/ZF-1616
> >>
> >> Hope this helps,
> >> -Ryan
> >>
> >> On 8/10/07, victorc <victor.coustenoblegmail.com> wrote:
> >>>
> >>>
> >>> Hi,
> >>>
> >>> I try to retrieve Picassa Web album info,
is someone already did
> that ?
> >>>
> >>> I have successfully get all posts from a
blogger blog but when I
> ask
> >>> albums
> >>> list from a Picassa Web account with the
feed url like
> >>>
> >>>
>
http://picasaweb.google.com/data/feed/api
/user/victor.coustenoble?start
> -index=1&max-results=1000&kind=album
> >>> for example, then I have the error message
"Expected response code
> 200,
> >>> got
> >>> 400"  in following errors :
> >>>
> >>> Fatal error: Uncaught exception
'Zend_Gdata_App_HttpException'
with
> >>> message
> >>> 'Expected response code 200, got 400' in
> >>>
/home/wb59649/picassa/Zend/Gdata/App.php:282 Stack trace:
#0
> >>>
/home/wb59649/picassa/Zend/Gdata/App.php(126):
> >>> Zend_Gdata_App::import('http://picasawe...',
> Object(Zend_Http_Client),
> >>> 'Zend_Gdata_Feed') #1
/home/wb59649/picassa/Zend/Gdata.php(109):
> >>> Zend_Gdata_App->getFeed('http://picasawe...',
'Zend_Gdata_Feed')
#2
> >>>
/home/wb59649/picassa/getalbumlist.php5(47):
> >>>
Zend_Gdata->getFeed(Object(Zend_Gdata_Query)) #3 
thrown in
> >>> /home/wb59649/picassa/Zend/Gdata/App.php
on line 282
> >>>
> >>> Any ideas ? 
> >>>
> >>> Thank you
> >>> Victor
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>> http:
//www.nabble.com/Get-Picassa-Web-Albums---
> tf4249038s16154.html#a12092343
> >>> Sent from the Zend gdata mailing list
archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >
> >
> 
> --
> View this message in context: http://www.nab
ble.com/Get-Picassa-Web-
> Albums---tf4249038s16154.html#a12778773
> Sent from the Zend gdata mailing list archive at
Nabble.com.


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )