public List <PicasaAlbumInfo> GetAlbumList() { if (!CheckAuthorization()) { return(null); } List <PicasaAlbumInfo> albumList = new List <PicasaAlbumInfo>(); NameValueCollection headers = new NameValueCollection(); headers.Add("Authorization", "Bearer " + AuthInfo.Token.access_token); string response = SendGetRequest("https://picasaweb.google.com/data/feed/api/user/default", null, ResponseType.Text, null, headers); if (!string.IsNullOrEmpty(response)) { XDocument xd = XDocument.Parse(response); if (xd != null) { foreach (XElement entry in xd.Descendants(AtomNS + "entry")) { PicasaAlbumInfo album = new PicasaAlbumInfo(); album.ID = entry.GetElementValue(GPhotoNS + "id"); album.Name = entry.GetElementValue(GPhotoNS + "name"); album.Summary = entry.GetElementValue(AtomNS + "summary"); albumList.Add(album); } } } return(albumList); }
public List <PicasaAlbumInfo> GetAlbumList() { if (!CheckAuthorization()) { return(null); } List <PicasaAlbumInfo> albumList = new List <PicasaAlbumInfo>(); string response = SendRequest(HttpMethod.GET, "https://picasaweb.google.com/data/feed/api/user/default", headers: GetAuthHeaders()); if (!string.IsNullOrEmpty(response)) { XDocument xd = XDocument.Parse(response); if (xd != null) { foreach (XElement entry in xd.Descendants(AtomNS + "entry")) { PicasaAlbumInfo album = new PicasaAlbumInfo(); album.ID = entry.GetElementValue(GPhotoNS + "id"); album.Name = entry.GetElementValue(GPhotoNS + "name"); album.Summary = entry.GetElementValue(AtomNS + "summary"); albumList.Add(album); } } } return(albumList); }
public List<PicasaAlbumInfo> GetAlbumList() { if (!CheckAuthorization()) return null; List<PicasaAlbumInfo> albumList = new List<PicasaAlbumInfo>(); NameValueCollection headers = new NameValueCollection(); headers.Add("Authorization", "Bearer " + AuthInfo.Token.access_token); string response = SendGetRequest("https://picasaweb.google.com/data/feed/api/user/default", null, ResponseType.Text, null, headers); if (!string.IsNullOrEmpty(response)) { XDocument xd = XDocument.Parse(response); if (xd != null) { foreach (XElement entry in xd.Descendants(AtomNS + "entry")) { PicasaAlbumInfo album = new PicasaAlbumInfo(); album.ID = entry.GetElementValue(GPhotoNS + "id"); album.Name = entry.GetElementValue(GPhotoNS + "name"); album.Summary = entry.GetElementValue(AtomNS + "summary"); albumList.Add(album); } } } return albumList; }
public List<PicasaAlbumInfo> GetAlbumList() { if (!CheckAuthorization()) return null; List<PicasaAlbumInfo> albumList = new List<PicasaAlbumInfo>(); string response = SendRequest(HttpMethod.GET, "https://picasaweb.google.com/data/feed/api/user/default", headers: GetAuthHeaders()); if (!string.IsNullOrEmpty(response)) { XDocument xd = XDocument.Parse(response); if (xd != null) { foreach (XElement entry in xd.Descendants(AtomNS + "entry")) { PicasaAlbumInfo album = new PicasaAlbumInfo(); album.ID = entry.GetElementValue(GPhotoNS + "id"); album.Name = entry.GetElementValue(GPhotoNS + "name"); album.Summary = entry.GetElementValue(AtomNS + "summary"); albumList.Add(album); } } } return albumList; }