3

I have implemented a method which manually scrapes the Search Twitter page and gets the tweets on different pages. But since there is a fast refresh rate, the method triggers an exception. Therefore I have decided to use TweetSharp API instead

 var search = FluentTwitter.CreateRequest()
                           .AuthenticateAs(TWITTER_USERNAME, TWITTER_PASSWORD)
                           .Users()
                           .SearchFor("dumbledore");

var result = search.Request();
var users = result.AsUsers();

this code was on the site. Does anyone know how I can avoid giving my credentials and retrieve from all users and not just the ones I have as friends?

Thanks!

Ozgur Dogus
  • 911
  • 3
  • 14
  • 38
Lilz
  • 4,013
  • 13
  • 61
  • 95
  • I assume you mean from all *public* feeds? There may be some privacy issues here that would preclude the availability of this functionality. – 3Dave Apr 21 '10 at 19:15

1 Answers1

0

What you want to do is interface with the Twitter Streaming API. This API allows you to open a persistent connection with Twitter and Twitter will then stream results to you as they come in.

Twitter Streaming API diagram

(taken from the Twitter Streaming API page)

That said, TweetSharp doesn't currently support the Streaming API. However, it's not difficult to open a connection to Twitter in .NET and process the responses as they're received (however, I'd recommend using the HttpClient class to process this asynchronously, as well as using a proper JSON parsing library, like Json.NET).

Note the third column in the diagram "Streaming connection process", specifically the middle part:

Receives streamed Tweets, performs processing and stores result

As well as the "HTTP Server process" column:

Server pulls processed result from data store and renders view.

While not explicitly mentioned, you are best off just persisting the Tweet as you get it into a data store and then having another process handle the Tweets; the volume of Tweets you might get is so high that performing any processing when you get the Tweet will backlog the receiving of new Tweets.

For your specific case, you'll want to access the Public Streams with a POST filter of "dumbledore".

Community
  • 1
  • 1
casperOne
  • 73,706
  • 19
  • 184
  • 253
  • Is there anything that can be done here to improve the answer? Does it not directly address what the OP is asking for, or did I miss something? – casperOne Aug 08 '12 at 18:48