10

I am currently trying to write some code to consumer the user stream from the Twitter streaming API:

http://dev.twitter.com/pages/user_streams

I am struggling to connect to it using basic auth and assume (the docs don't say) that OAuth is required.

However I cannot find a Twitter .NET library that supports streaming and OAuth (actually, haven't found any with decent samples/docs on consuming the streaming API).

Does anyone know of any? Currently I have written my own code to consume the sample stream using C# and dynamic but really don't want to have to implement OAuth (people say its complex).

Edit:

Although, I have been able to get an access token and access token secret via the TweetSharp library fine, I have no clue on how to generate the required headers/implement oauth, which could be another option I guess rather than a full library.

Short version:

  • Looking for a library that supports streaming API and OAuth
  • Advise on implementing OAuth manually
Phil
  • 3,652
  • 5
  • 35
  • 56
  • 2
    Basic auth isn't allowed anymore. – Ikke Mar 01 '11 at 11:58
  • thanks, lkke, thought so judging on the 401 I kept getting – Phil Mar 01 '11 at 12:12
  • Maybe [Twitter API + OAuth: Can't send status updates, getting 401](http://stackoverflow.com/questions/971369/twitter-api-oauth-cant-send-status-updates-getting-401) can help. – Thomas Freudenberg Mar 01 '11 at 15:02
  • @Thomas my app's permissions are fine, posted an update to a test account fine, its just the streaming api is quite new and not supported by the main wrapper libraries that I can find. – Phil Mar 01 '11 at 16:16
  • Why aren't you using DotNetOpenAuth? They even have examples for working with twitter. http://stackoverflow.com/questions/4821747/facebook-twitter-with-dotnetopenauth – George Stocker Feb 15 '12 at 20:11

3 Answers3

6

As I explained in this post Consuming twitter stream API, Tweetinvi API provides easy to configure Streaming API access.

You can download it here : http://tweetinvi.codeplex.com/

A Stream class exist and will enable you to easily implement a delegate to read the content coming from Twitter.

The class has been tested on real-life projects and is able to retrieve millions of tweets per day.

I am one of the developer working on the project.

Community
  • 1
  • 1
linvi
  • 115
  • 1
  • 7
1

Check Shannon Whitley post: Twitter oAuth with .NET

Branimir
  • 4,101
  • 19
  • 31
1

I've used the TweetSharp library in the past, which supports OAuth.

Finster
  • 478
  • 1
  • 8
  • 23
Thomas Freudenberg
  • 4,960
  • 1
  • 36
  • 42