question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with GetUserTimeline

See original GitHub issue

I write a code to like n last tweet of a user . this is my code

var user = Tweetinvi.User.GetAuthenticatedUser();

var suser = Tweetinvi.User.GetUserFromScreenName(uname);

if (suser != null)
{
	var timeline = Timeline.GetUserTimeline(suser.Id, n);

	foreach (var item in timeline)
	{
		var success = Tweet.FavoriteTweet(item);
	}
}

sometimes last n tweets returned and sometimes random n tweets returned

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
StephenMPcommented, Apr 10, 2018

You can use the UserTimelineParameters class to specify how you want to get the user’s timeline.

Here’s how you can get the user’s timeline WITHOUT replies (this would be the same as if you were looking at the user’s Tweets tab).

var timelineParameters = new UserTimelineParameters
{
          // ExcludeReplies is what controls whether you see the Tweets tab or Tweets & Replies tab
          ExcludeReplies = false,
          MaximumNumberOfTweetsToRetrieve = n
};

var timeline = Timeline.GetUserTimeline(authenticatedUser, timelineParameters);
0reactions
mmshahshahanicommented, May 9, 2018

Hi Thank you for attention

this is the code :

` Auth.SetUserCredentials(Classes.MyCredentials.CONSUMER_KEY, Classes.MyCredentials.CONSUMER_SECRET, isUser.UserTweeterAccessToken, isUser.UserTweeterAccessTokenSecret);

                        var user = Tweetinvi.User.GetAuthenticatedUser();

                        var suser = Tweetinvi.User.GetUserFromScreenName(uname);

                        if (suser != null)
                        {
                            var timelineParameters = new UserTimelineParameters
                            {
                                // ExcludeReplies is what controls whether you see the Tweets tab or Tweets & Replies tab
                                IncludeRTS = true,
                                ExcludeReplies = true,
                                MaximumNumberOfTweetsToRetrieve = amount
                            };

                            var timeline = Timeline.GetUserTimeline(suser, timelineParameters);

                            foreach (var item in timeline)
                            {
                                var success = Tweet.FavoriteTweet(item);
                            }
                        }

`

the username is stephanieMUFCxx but it is not the only one .

I want to like fore example last 16 tweets but 11 first tweets likes today . last week 5 last tweets liked and some tweets did not like and after that 3 tweets liked .

the URLs :

https://api.twitter.com/1.1/account/verify_credentials.json?skip_status=true&include_entities=true&include_email=true

https://api.twitter.com/1.1/users/show.json?screen_name=stephaniemufcxx

https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=177994073&include_rts=True&exclude_replies=True&contributor_details=False&count=16&trim_user=False&include_entities=True

https://api.twitter.com/1.1/favorites/create.json?id=993662175419031552

https://api.twitter.com/1.1/favorites/create.json?id=993655954016296961

and …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Limit problem while connecting to API ( getusertimeline) with ...
Recently I realized that new twitter account while trying to connect to twitter API get limit rate error ( older works fine )....
Read more >
Twython' object has no attribute 'getUserTimeline'
According to the twithon documentation there is no getUserTimeline function there is however a get_user_timeline function.
Read more >
GET statuses/user_timeline | Docs
Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters. User timelines belonging to...
Read more >
Overview | Docs | Twitter Developer Platform
Returns the 20 most recent mentions (Tweets containing a users's @handle) for the authenticating user. Get Tweet timelines.
Read more >
TimelineOperations (Spring Social Twitter 1.1.2.RELEASE ...
Retrieves tweets posted by the authenticating user. List<Tweet>, getUserTimeline(long userId). Retrieves the 20 most recent tweets posted by the given user.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found