Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Sascha Tayefeh http://www.tayefeh.de

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Using Google's API to Access Picasa Albums

Google provides its API in multiple languages. Here is an example that shows how to access a picasa album.

Before you start, you need to download Google's API for .NET. Then copy the files to you project (in the project explorer) in Visual Studio and in the references in the project explorer. Now you can make use of the namespaces:

using Google.GData.Client;
using Google.GData.Photos;

   1  
   2  namespace GetPicasaFeed
   3  {
   4      public partial class Form1 : Form
   5      {
   6          public Form1()
   7          {
   8              InitializeComponent();
   9              this.getAtomFeed();
  10              return;
  11          }
  12  
  13          private void getAtomFeed()
  14          {
  15  
  16              // Album query and picasa query are specialized atomfeed classes
  17              AlbumQuery aQuery = new AlbumQuery(PicasaQuery.CreatePicasaUri("saschatayefeh"));
  18              PicasaService pService = new PicasaService("PicasaDemo");
  19              AtomFeed kResultFeed = pService.Query(aQuery);
  20  
  21              foreach (AtomEntry entry in kResultFeed.Entries)
  22              {
  23                  this.textBox1.AppendText(entry.Title.Text + "\r\n");
  24                  foreach (AtomLink eLink in entry.Links)
  25                  {
  26                      this.textBox1.AppendText("  " + eLink.HRef.ToString() + "\r\n"); ;
  27                  }
  28              }
  29              return;
  30          }
  31  
  32   
  33      }
  34  }
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS