Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 23, 2012 06:18
Show Gist options
  • Save sandrinodimattia/3162232 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3162232 to your computer and use it in GitHub Desktop.
GoogleSession sample
class Program
{
static void Main(string[] args)
{
// Empty line.
Console.WriteLine("");
// Get username.
Console.Write(" Enter your Google username: ");
string username = Console.ReadLine();
// Get password.
Console.Write(" Enter your password: ");
string password = Console.ReadLine();
// Authenticate.
string auth = ClientLogin.GetAuthToken("reader", username, password, "Sandworks.Google.App");
// Query.
using (GoogleSession session = new GoogleSession(auth))
{
var feed = session.GetFeed("http://www.google.com/reader/atom/user/-/state/com.google/reading-list",
new GoogleParameter("n", "5"));
// Display.
Console.WriteLine("");
Console.WriteLine(" Last 5 articles in Google Reader: ");
foreach (var item in feed.Items)
{
Console.WriteLine(" - " + item.Title.Text);
}
}
// Pause.
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment