mirror of
https://github.com/NicolasConstant/BirdsiteLive
synced 2025-06-05 21:49:16 +02:00
extract only needed info from tweets
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BirdsiteLive.DAL.Models;
|
||||
using BirdsiteLive.Twitter.Models;
|
||||
using Tweetinvi.Models;
|
||||
|
||||
namespace BirdsiteLive.Pipeline.Models
|
||||
@@ -6,7 +7,7 @@ namespace BirdsiteLive.Pipeline.Models
|
||||
public class UserWithTweetsToSync
|
||||
{
|
||||
public SyncTwitterUser User { get; set; }
|
||||
public ITweet[] Tweets { get; set; }
|
||||
public ExtractedTweet[] Tweets { get; set; }
|
||||
public Follower[] Followers { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using BirdsiteLive.DAL.Models;
|
||||
using BirdsiteLive.Pipeline.Contracts;
|
||||
using BirdsiteLive.Pipeline.Models;
|
||||
using BirdsiteLive.Twitter;
|
||||
using BirdsiteLive.Twitter.Models;
|
||||
using Tweetinvi.Models;
|
||||
|
||||
namespace BirdsiteLive.Pipeline.Processors
|
||||
@@ -51,9 +52,9 @@ namespace BirdsiteLive.Pipeline.Processors
|
||||
return usersWtTweets.ToArray();
|
||||
}
|
||||
|
||||
private ITweet[] RetrieveNewTweets(SyncTwitterUser user)
|
||||
private ExtractedTweet[] RetrieveNewTweets(SyncTwitterUser user)
|
||||
{
|
||||
ITweet[] tweets;
|
||||
ExtractedTweet[] tweets;
|
||||
if (user.LastTweetPostedId == -1)
|
||||
tweets = _twitterService.GetTimeline(user.Acct, 1);
|
||||
else
|
||||
|
||||
@@ -10,6 +10,7 @@ using BirdsiteLive.Domain;
|
||||
using BirdsiteLive.Pipeline.Contracts;
|
||||
using BirdsiteLive.Pipeline.Models;
|
||||
using BirdsiteLive.Twitter;
|
||||
using BirdsiteLive.Twitter.Models;
|
||||
using Tweetinvi.Models;
|
||||
|
||||
namespace BirdsiteLive.Pipeline.Processors
|
||||
@@ -50,7 +51,7 @@ namespace BirdsiteLive.Pipeline.Processors
|
||||
return userWithTweetsToSync;
|
||||
}
|
||||
|
||||
private async Task ProcessFollowerAsync(IEnumerable<ITweet> tweets, Follower follower, int userId,
|
||||
private async Task ProcessFollowerAsync(IEnumerable<ExtractedTweet> tweets, Follower follower, int userId,
|
||||
SyncTwitterUser user)
|
||||
{
|
||||
var fromStatusId = follower.FollowingsSyncStatus[userId];
|
||||
|
||||
Reference in New Issue
Block a user