• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • Last Modified:

consuming twitter streaming api from asp.net c#

Hi experts,

I need to integrate the twitter streaming API within an asp.net 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.
0
robespierre_2010
Asked:
robespierre_2010
  • 6
1 Solution
 
BardobraveCommented:
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.
0
 
robespierre_2010Author Commented:
Hi,

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?

Regards.
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 = "https://stream.twitter.com/1/statuses/filter.json?track=bilbao";
        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)
        {
            Console.WriteLine(responseStream.ReadLine());
        }

        }
    }
}

Open in new window

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

need to delete
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
robespierre_2010Author Commented:
sdgf
0
 
robespierre_2010Author Commented:
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:

asdf
0
 
robespierre_2010Author Commented:
sdag
0
 
robespierre_2010Author Commented:
need to reopen the question
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now