Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tweetsharp: Retrieve list of tweets from a specific user

Couldn't find this in the official TS documentation, other Tweetsharp SO posts, or digging through the library's classes; so I thought I'd ask. How do you retrieve a list of the most recent Tweets from a specific user using Tweetsharp?

You can assume I'm authenticating with an account that is following the user whom's tweets I want to retrieve. I may even be able to authenticate with the account of the user itself.

like image 286
Frank Rosario Avatar asked Nov 15 '12 00:11

Frank Rosario


2 Answers

Use ListTweetsOnSpecifiedUserTimeline().

For example:

var service = new TwitterService(ConsumerKey, ConsumerSecret);
service.AuthenticateWith(AccessToken, AccessTokenSecret);
var currentTweets = service.ListTweetsOnSpecifiedUserTimeline(screenName:"screen name", page:1, count:100);
like image 95
Ronald Boehm Avatar answered Nov 06 '22 02:11

Ronald Boehm


The method is a little different in updated versions. Its now called ListTweetsOnUserTimeline()

and it your going to pass through options now like so:

  var currentTweets = service.ListTweetsOnUserTimeline(new ListTweetsOnUserTimelineOptions
                {
                    ScreenName = "yourTwitterHandle",
                    Count = 5,
                });
like image 28
Connor Williams Avatar answered Nov 06 '22 03:11

Connor Williams