consuming twitter streaming api from c#

Posted on 2011-10-25
Last Modified: 2013-11-10
Hi experts,

I need to integrate the twitter streaming API within an website using c# with visual studio 2010. Does someone have a simple example that I can get to work fast?

Thanks in advance and regards.
Question by:robespierre_2010
    LVL 19

    Accepted Solution

    First of all you'll need to deal with oAuth protocol and the validation of accounts from external sites to allow your app to being able to get through twitter and retrieve info.

    Sadly I have no specific twitter examples, as all the work I've done so far with this is with linkedIn, although they also use oAuth protocol to integrate the external authentication, you'll need to check twitter API reference, as both protocol implementations are different.

    Author Comment


    I have done some research and found a way to do this on a .net windows console application (see attached code). Now, I just need to do the same thing on a .net website. Maybe an Ajax Update Panel? Can you help with this?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Web;
    using System.Net;
    using System.IO;
    namespace ConsoleApplication1
        class Program
            static void Main(string[] args)
            string url = "";
            WebRequest request = WebRequest.Create(url);
            request.Credentials = new NetworkCredential("rgapi1789","hendrix");
            var webResponse = request.GetResponse();
            Encoding encode = Encoding.GetEncoding("utf-8");
            var responseStream = new StreamReader(webResponse.GetResponseStream(), encode);
            while (!responseStream.EndOfStream)

    Open in new window


    Author Comment

    I've requested that this question be deleted for the following reason:

    need to delete

    Author Comment


    Author Comment

    I've requested that this question be closed as follows:

    Accepted answer: 0 points for robespierre_2010's comment http:/Q_27413829.html#37024306

    for the following reason:


    Author Comment


    Author Closing Comment

    need to reopen the question

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One C# Help from Top Experts

    Solve your toughest problems, fast.
    C# experts are online now and ready to help you.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and Log…
    The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now