11 messages in com.googlegroups.google-picasa-data-apiRe: finding "normal" web-url trough t...| From | Sent On | Attachments |
|---|---|---|
| nhui...@gmail.com | 15 Jan 2008 18:04 | |
| Ryan Boyd (Google) | 15 Jan 2008 18:31 | |
| Ryan Boyd (Google) | 15 Jan 2008 18:35 | |
| nhui...@gmail.com | 16 Jan 2008 01:41 | |
| kwylez | 16 Jan 2008 05:46 | |
| nhui...@gmail.com | 16 Jan 2008 13:26 | |
| Ryan Boyd (Google) | 16 Jan 2008 13:59 | |
| kwylez | 17 Jan 2008 04:37 | |
| kwylez | 17 Jan 2008 05:07 | |
| nhui...@gmail.com | 17 Jan 2008 13:42 | |
| Bob | 29 Jan 2008 14:18 |
| Subject: | Re: finding "normal" web-url trough the API (using ZEND framework)![]() |
|---|---|
| From: | nhui...@gmail.com (nhui...@gmail.com) |
| Date: | 01/16/2008 01:41:52 AM |
| List: | com.googlegroups.google-picasa-data-api |
Hi Ryan,
Thanks! I can't believe i didn't try that yesterday (although it was kinda late :) ). $entry->alternateLink->href works like a charm (even on the non- authenticated server-connection i'm using)!
I did try to use entry->getLink('alternate'); at some point, but that doesn't return anything usefull as far as i can echo :) (looks empty?)
Well thanks again!
Nanne
On Jan 16, 3:36 am, "Ryan Boyd (Google)" <api....@google.com> wrote:
Note that $entry->getAlternateLink() or $entry->alternateLink just ends up calling $entry->getLink('alternate');
The getLink() method returns the full array by default, or a single Zend_Gdata_App_Extension_Link element if you pass a rel value which it finds in the array.
The docs on the getLink method (and others) need some improvement.
Cheers, -Ryan
On Jan 15, 2008 6:32 PM, Ryan Boyd (Google) <api....@google.com> wrote:
Hi Nanne,
You're looking in the right place. You need the link with a rel='alternate'. Following this message is some code to get that.
You can also get the unique value used in the URL out separately if you want-- that's also shown in the code below.
Cheers, -Ryan
<?php
require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Photos');
// Parameters for ClientAuth authentication $service = Zend_Gdata_Photos::AUTH_SERVICE_NAME; $user = 'email address'; $pass = 'password';
// Create an authenticated HTTP client $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
// Create an instance of the Base service $service = new Zend_Gdata_Photos($client);
$feed = $service->getUserFeed();
foreach ($feed as $entry) { echo $entry->title->text . "\n"; // the full link href echo $entry->alternateLink->href . "\n"; // the 'unique identifier' echo $entry->gphotoName->text . "\n";
}
Hello all,
I"m fairly new to the Google API game: I was busy trying to come up with a google-feed parser when luckily someone kicked me towards the API :). now I'm using the ZEND-php framework, and i can successfully request an album list, including title and summary etc etc...
One problem, I can't find a really clear description of where to find what data. There are numerous lists of available methods etc, but i couldn't find any real explanation of what info comes from where. And that is probably the base for the following question:
I can find the title (as you can see below), and i use that to make the album feed. Not the cleanest way, but i thought it would work. just link tohttp://www.picasaweb.com/USERNAME/ALBUMNAME... well, problem is that when there is whitespace, an "-" or probably some other things in the album name, they get removed in the URL. So this method doesn't work :(.
Can anybody point me to the place i can find the link? I've been looking into the method "getLink()" ofcourse, but this gives me a BIG array, that does contain the right information i guess, but i'm not keen on parsing that array -> i would rather just use the correct method.
Abbreviated and anonymized code:
$service = new Zend_Gdata_Photos(); $userFeed = $service->getUserFeed("USERNAME"); foreach ($userFeed as $entry) { if ($entry instanceof Zend_Gdata_Photos_AlbumEntry) {
//this doesn't work. echo('<a href='http://picasaweb.google.com/".$userFeed->getTitle() . "/" . $entry->getTitle() ."'>".$entry->getTitle()."</a>');
//loads of info :) dirty hack? print_r($entry->getLink()); } }
If someone could help me i would be grateful :)




