Created
July 23, 2012 06:18
-
-
Save sandrinodimattia/3162232 to your computer and use it in GitHub Desktop.
GoogleSession sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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