Click here to Skip to main content
Click here to Skip to main content


By , 4 Oct 2012
Rate this:
Please Sign up or sign in to vote.


The code shown here allows a user to get all public tweets of her /his liking without logging into Twitter and search for tweets with keywords. It also allows the user to search for his/her friends who are tagged in his/her albums.

Using the code

The code uses Twitter API and Facebook API.

Whenever a user enters the name then it is added to Screen_Name. E.g.: If I enter Ravi then the link will look at getting all public tweets made by the user (we can get only the top 200 tweets (public)).

We are using the asynch features of .NET 4.5 so the application will not hang during the download and the user can download pictures from Facebook and search for friends who are tagged in Facebook and can also share their pics which are locally stored.

After successful download of the tweets the user can download and search the tweets with any keyword.

//The Following Code will Download the Tweets
private async void gettweets_Tapped(object sender, TappedRoutedEventArgs e) {
//We used Tapped event so that application can sense touch event as well.
Windows.Web.Syndication.SyndicationClient client = new Windows.Web.Syndication.SyndicationClient();
// Force the SyndicationClient to download the information.
client.BypassCacheOnRetrieve = true;
Uri feedUri = new Uri("" + 
try {
    // Call SyndicationClient RetrieveFeedAsync to download the list of blog posts.
    Windows.Web.Syndication.SyndicationFeed feed = await client.RetrieveFeedAsync(feedUri); 
    // The rest of this method executes after await RetrieveFeedAsync completes. 
    Tweets.Text = feed.Title.Text + Environment.NewLine; 
    foreach (SyndicationItem item in feed.Items) 
        Tweets.Text += item.Title.Text + ", " + 
               item.PublishedDate.ToString() + Environment.NewLine; 
catch (Exception ex) { 
    // Log Error. 
    Tweets.Text = "I'm sorry, but I couldn't load the page," + 
      " possibly due to network problems." + 
      "Here's the error message I received: " + ex.ToString();

The following code will search for a keyword within the public tweets:

var subset = from g in textbx1.Text where g.Contains(searchTb.Text) select g;
foreach (var stat in subset)
    richTextBox1.Text += stat + "\n" + 
      "_________________________________________________________" + "\n";

Similarly we use the Facebook API and download pictures from albums and share them if they are locally available.

Users can see all public tweets without logging into Twitter and can search for friends who are tagged in their albums.

Points of interest

Here we are using the Tap event in order to make the application completely use the touch features of the Intel Ultrabook. We used the Twitter API and FaceBook API along with C# 4.5 and XAML. We can also download the tweets in XML format.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

No Biography provided

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 4 Oct 2012
Article Copyright 2012 by ravichaitanya.m
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid