8

I am trying to retrieve public tweets from a server-side application, using application-only authentication (no user context).

The following code works fine:

var service = new TwitterService("<consumer key>", "<consumer secret>");
service.AuthenticateWith("<access token>", "<access token secret>"); 

var options = new ListTweetsOnUserTimelineOptions { ScreenName = "billgates" };

foreach (var tweet in service.ListTweetsOnUserTimeline(options))
    Console.WriteLine(tweet.Text);

However I gather from this diagram that it shouldn't be necessary to provide the access token/secret:

Application-only authentication

However when I remove the call to AuthenticateWith, ListTweetsOnUserTimeline returns null.

It is a limitation of the library, if not, how can I do it?

EDIT

Aas far as I can tell, this calls the GET statuses/user_timeline method that should support application-only authentication, as per the documentation:

API methods that support this form of authentication will contain two rate limits in their documentation, one that is per user (for application-user authentication) and the other is per app (for this form of application-only authentication)

The GET statuses/user_timeline method has these 2 limits shown in its documentation.

Jimbo
  • 25,790
  • 15
  • 86
  • 131
Xavier Poinas
  • 19,377
  • 14
  • 63
  • 95

2 Answers2

1

I think this in not a limitation of the library, but limitation of the Twitter API.

As far as I know, the ListTweetsOnUserTimeline() method uses statuses/user_timeline API call.

GET statuses/user_timeline

As you can see, this call requires authentication.

You can try to use the Streaming API for getting statuses. I can't help you here since I have only experience with user streams, not public.

Public streams

Besides, the TweetSharp has some problems with streams, I had to switch to Linq2Twitter library.

Ronnix
  • 310
  • 4
  • 12
  • I think this method should support application-only auth, which I guess is it a form of authentication, hence the `Authentication: Required` (see my edits in the question). – Xavier Poinas Mar 13 '13 at 22:07
  • From what I've been able to read, I don't believe you can use streams without authenticating with the user. – James Mertz Aug 14 '13 at 19:49
1

This is confirmed as not being supported: https://github.com/danielcrenna/tweetsharp/issues/80#issuecomment-19862455

As this project is being retired, there is no plan to add support for it.

Xavier Poinas
  • 19,377
  • 14
  • 63
  • 95