public async ValueTask <IEnumerable <TwitterStatus> > GetUserTimeline(string screenName) { return(await oAuthApiRequest .GetAsync <IEnumerable <TwitterStatus> >("https://api.twitter.com/1.1/statuses/user_timeline.json", new[] { TwitterOptions.ScreenName(screenName), TwitterOptions.Count(50), TwitterOptions.IncludeEntities(), TwitterOptions.IncludeRetweets(), TwitterOptions.ExtendedTweetMode() }) .ConfigureAwait(false)); }
public async ValueTask <User> UserInfo(string screenName) { var user = await oAuthApiRequest .GetAsync <User>("https://api.twitter.com/1.1/users/show.json", new[] { TwitterOptions.IncludeEntities(), TwitterOptions.ExtendedTweetMode(), TwitterOptions.ScreenName(screenName) }) .ConfigureAwait(false); if (UserConnectionsService.LookupUserConnections(user.Id) is { } userConnections) { user.IsFollowing = userConnections.IsFollowing; user.IsFollowedBy = userConnections.IsFollowedBy; } return(user); }
public ValueTask Unfollow(string screenName) { return(oAuthApiRequest .PostAsync("https://api.twitter.com/1.1/friendships/destroy.json", new[] { TwitterOptions.ScreenName(screenName) })); }