removed unused nbrTweets

This commit is contained in:
Vincent Cloutier 2023-01-20 09:28:32 -05:00
parent 08f5aef7fc
commit 48d521b757
3 changed files with 12 additions and 5 deletions

View file

@ -84,9 +84,9 @@ namespace BirdsiteLive.Pipeline.Processors
try
{
if (user.LastTweetPostedId == -1)
tweets = await _twitterTweetsService.GetTimelineAsync(user.Acct, 1);
tweets = await _twitterTweetsService.GetTimelineAsync(user.Acct);
else
tweets = await _twitterTweetsService.GetTimelineAsync(user.Acct, 200, user.LastTweetSynchronizedForAllFollowersId);
tweets = await _twitterTweetsService.GetTimelineAsync(user.Acct, user.LastTweetSynchronizedForAllFollowersId);
}
catch (Exception e)
{

View file

@ -20,7 +20,7 @@ namespace BirdsiteLive.Twitter
public interface ITwitterTweetsService
{
Task<ExtractedTweet> GetTweetAsync(long statusId);
Task<ExtractedTweet[]> GetTimelineAsync(string username, int nberTweets, long fromTweetId = -1);
Task<ExtractedTweet[]> GetTimelineAsync(string username, long fromTweetId = -1);
}
public class TwitterTweetsService : ITwitterTweetsService
@ -78,7 +78,7 @@ namespace BirdsiteLive.Twitter
}
}
public async Task<ExtractedTweet[]> GetTimelineAsync(string username, int nberTweets, long fromTweetId = -1)
public async Task<ExtractedTweet[]> GetTimelineAsync(string username, long fromTweetId = -1)
{
var client = await _twitterAuthenticationInitializer.MakeHttpClient();

View file

@ -39,11 +39,18 @@ namespace BirdsiteLive.ActivityPub.Tests
[TestMethod]
public async Task TimelineKobe()
{
var tweets = await _tweetService.GetTimelineAsync("kobebryant", 100, 1218020971346444288);
var tweets = await _tweetService.GetTimelineAsync("kobebryant", 1218020971346444288);
Assert.AreEqual(tweets[0].MessageContent, "Continuing to move the game forward @KingJames. Much respect my brother 💪🏾 #33644");
Assert.AreEqual(tweets.Length, 8);
}
[TestMethod]
public async Task TimelineGrant()
{
var tweets = await _tweetService.GetTimelineAsync("grantimahara", default);
Assert.IsTrue(tweets[0].IsReply);
Assert.AreEqual(tweets.Length, 40);
}
}
}