From 238832cbbdd75dddd2e9ae6c89ada3950f508c16 Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Fri, 25 Nov 2022 15:05:05 -0500 Subject: [PATCH] some fixes --- src/BirdsiteLive.Twitter/TwitterTweetsService.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs index cbcfe43..7c0d214 100644 --- a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs +++ b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs @@ -4,6 +4,7 @@ using System.Linq; using System.IO; using System.Net.Http; using System.Text.Json; +using System.Text.Json.Nodes; using System.Threading.Tasks; using BirdsiteLive.Common.Settings; using BirdsiteLive.Statistics.Domain; @@ -145,9 +146,9 @@ namespace BirdsiteLive.Twitter MessageContent = tweet.GetProperty("content").GetProperty("itemContent") .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") .GetProperty("full_text").GetString(), - CreatedAt = tweet.GetProperty("content").GetProperty("itemContent") - .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") - .GetProperty("created_at").GetDateTime(), + CreatedAt = DateTime.Now, //tweet.GetProperty("content").GetProperty("itemContent") +// .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") +// .GetProperty("created_at").GetDateTime(), IsReply = false, IsThread = false, IsRetweet = false, @@ -155,11 +156,12 @@ namespace BirdsiteLive.Twitter RetweetUrl = "https://t.co/123", OriginalAuthor = null, }; - extractedTweets.Append(extractedTweet); + extractedTweets.Add(extractedTweet); } catch (Exception e) { - _logger.LogError("Tried getting timeline from user " + username + ", but got error: \n" + e.Message + e.StackTrace + e.Source); + _logger.LogError("Tried getting timeline from user " + username + ", but got error: \n" + e.Message + e.StackTrace + e.Source + + JsonObject.Create(tweet).ToJsonString(new JsonSerializerOptions { WriteIndented = true })); } }