This commit is contained in:
Vincent Cloutier 2022-05-14 11:19:35 -04:00
parent 92aa9388fe
commit e53beb1f9d
2 changed files with 24 additions and 14 deletions

View file

@ -67,9 +67,10 @@ namespace BirdsiteLive.Domain
var content = extractedTags.content;
if (tweet.IsRetweet)
{
content = "RT: " + content;
// content = "RT: " + content;
cc = new[] {"https://www.w3.org/ns/activitystreams#Public"};
}
cc = new[] {"https://www.w3.org/ns/activitystreams#Public"};
string inReplyTo = null;
// if (tweet.InReplyToStatusId != default)

View file

@ -167,6 +167,8 @@ namespace BirdsiteLive.Twitter
var extractedMedia = Array.Empty<ExtractedMedia>();
JsonElement attachments;
try
{
if (tweet.TryGetProperty("attachments", out attachments))
{
foreach (JsonElement m in attachments.GetProperty("media_keys").EnumerateArray())
@ -189,6 +191,13 @@ namespace BirdsiteLive.Twitter
}
}
}
catch (Exception e)
{
_logger.LogError("Tried getting media from tweet, but got error:", e);
}
var extractedTweet = new ExtractedTweet
{