8 messages in com.googlegroups.google-picasa-data-apiRe: Get the photo info by the single ...| From | Sent On | Attachments |
|---|---|---|
| H3 | 22 Oct 2007 01:23 | |
| Frank Mantek | 22 Oct 2007 02:07 | |
| H3 | 22 Oct 2007 02:24 | |
| Frank Mantek | 22 Oct 2007 02:40 | |
| H3 | 23 Oct 2007 00:25 | |
| Frank Mantek | 23 Oct 2007 00:42 | |
| Sven | 24 Oct 2007 09:49 | |
| H3 | 24 Oct 2007 22:57 |
| Subject: | Re: Get the photo info by the single photo feed uri.![]() |
|---|---|
| From: | Frank Mantek (fman...@gmail.com) |
| Date: | 10/22/2007 02:40:55 AM |
| List: | com.googlegroups.google-picasa-data-api |
As i have no idea from you snippet how you are getting the service etc constructed, i would advice you to either look at the sourcecode for the phototool sample application, or the phottest.cs file in the unittest directory (excerpts below):
PhotoQuery query = new PhotoQuery(); PicasaService service = new PicasaService("unittests"); service.Credentials = new GDataCredentials(this.userName, this.passWord); query.Uri = new Uri(this.defaultPhotosUri); PicasaFeed feed = service.Query(query); foreach (PicasaEntry entry in feed.Entries) { Tracing.TraceMsg("Found an entry " + entry.ToString()); DisplayExtensions(entry);
GeoRssWhere w = entry.Location; if (w != null) { Tracing.TraceMsg("Found an location " + w.Lattitude + w.Longitude); }
ExifTags tags = entry.Exif; if (tags != null) { Tracing.TraceMsg("Found an exif block "); }
MediaGroup group = entry.Media; if (group != null)
Frank Mantek Google
Your code doesn't work.
PicasaFeed class hasn't got the Media property, and i also try to use photo.Entries[0] to return a PicasaEntry, but it returns null. :(
On Oct 22, 5:08 pm, Frank Mantek <fman...@gmail.com> wrote:
I think the problem is that a MediaCredit is not a child of a photo, but a child of a MediaGroup element. This code if from the top of my head, but with some VS help, you should be able to make it work:
PicasaFeed photo = (PicasaFeed)myService.Query(feedquery);
MediaGroup media = photo.Media // that property is on the picasaentry parent class if (media != null) { MediaCredit credit = media.Credit; if (credit != null) console.writeline(credit.value); }
}
That should work.
Frank Mantek Google
On Oct 22, 2007, at 10:23 AM, H3 wrote:
i get a photo info by a photo uri like "http://picasaweb.google.com/ data/feed/api/user/<userid>/albumid/<albumid>/photoid/<photoid>",
The server can return the full xml for me, but the api has some problem, it just can obtains the elements which without namespace like id, title, etc.
Others elements with namespace media, the api doesn't give me any result.
Here is my code(i'm using .net api library):
string photoStr = "http://picasaweb.google.com/data/feed/api/user/ <userid>/albumid/<albumid>/photoid/<photoid>";
FeedQuery feedquery = new FeedQuery(photoStr);
// AtomFeed photo = myService.Query(feedquery); <--doesn't work,too PicasaFeed photo = (PicasaFeed)myService.Query(feedquery);
// Output nothing Console.WriteLine(photo.FindExtension (MediaRssNameTable.MediaRssCredit, MediaRssNameTable.NSMediaRss));
// Output 0 Console.WriteLine(photo.FindExtensions (MediaRssNameTable.MediaRssThumbnail, MediaRssNameTable.NSMediaRss).Count);




