Twitter API application-only authentication (with TweetSharp)
Asked Answered
F

2

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.

Fideism answered 13/3, 2013 at 3:31 Comment(2)
any luck with this method?Szombathely
For those interested, the issue on GitHub: github.com/danielcrenna/tweetsharp/issues/80Fideism
F
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.

Fideism answered 23/6, 2013 at 23:12 Comment(0)
S
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.

Stellastellar answered 13/3, 2013 at 7:53 Comment(2)
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).Fideism
From what I've been able to read, I don't believe you can use streams without authenticating with the user.Marj
F
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.

Fideism answered 23/6, 2013 at 23:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.