added replies
This commit is contained in:
parent
1bfa115750
commit
84de2c5f4a
1 changed files with 19 additions and 3 deletions
|
@ -159,6 +159,22 @@ namespace BirdsiteLive.Twitter
|
||||||
|
|
||||||
JsonElement retweet;
|
JsonElement retweet;
|
||||||
TwitterUser OriginalAuthor;
|
TwitterUser OriginalAuthor;
|
||||||
|
JsonElement inReplyToPostIdElement;
|
||||||
|
JsonElement inReplyToUserElement;
|
||||||
|
string inReplyToUser = null;
|
||||||
|
long? inReplyToPostId = null;
|
||||||
|
|
||||||
|
bool isReply = tweet.GetProperty("content").GetProperty("itemContent")
|
||||||
|
.GetProperty("tweet_results").GetProperty("result").GetProperty("legacy")
|
||||||
|
.TryGetProperty("in_reply_to_status_id_str", out inReplyToPostIdElement);
|
||||||
|
tweet.GetProperty("content").GetProperty("itemContent")
|
||||||
|
.GetProperty("tweet_results").GetProperty("result").GetProperty("legacy")
|
||||||
|
.TryGetProperty("in_reply_to_screen_name", out inReplyToUserElement);
|
||||||
|
if (isReply)
|
||||||
|
{
|
||||||
|
inReplyToPostId = Int64.Parse(inReplyToPostIdElement.GetString());
|
||||||
|
inReplyToUser = inReplyToUserElement.GetString();
|
||||||
|
}
|
||||||
bool isRetweet = tweet.GetProperty("content").GetProperty("itemContent")
|
bool isRetweet = tweet.GetProperty("content").GetProperty("itemContent")
|
||||||
.GetProperty("tweet_results").GetProperty("result").GetProperty("legacy")
|
.GetProperty("tweet_results").GetProperty("result").GetProperty("legacy")
|
||||||
.TryGetProperty("retweeted_status_result", out retweet);
|
.TryGetProperty("retweeted_status_result", out retweet);
|
||||||
|
@ -190,11 +206,11 @@ namespace BirdsiteLive.Twitter
|
||||||
var extractedTweet = new ExtractedTweet
|
var extractedTweet = new ExtractedTweet
|
||||||
{
|
{
|
||||||
Id = Int64.Parse(tweet.GetProperty("sortIndex").GetString()),
|
Id = Int64.Parse(tweet.GetProperty("sortIndex").GetString()),
|
||||||
InReplyToStatusId = null,
|
InReplyToStatusId = inReplyToPostId,
|
||||||
InReplyToAccount = null,
|
InReplyToAccount = inReplyToUser,
|
||||||
MessageContent = MessageContent,
|
MessageContent = MessageContent,
|
||||||
CreatedAt = DateTime.ParseExact(creationTime, "ddd MMM dd HH:mm:ss yyyy", System.Globalization.CultureInfo.InvariantCulture),
|
CreatedAt = DateTime.ParseExact(creationTime, "ddd MMM dd HH:mm:ss yyyy", System.Globalization.CultureInfo.InvariantCulture),
|
||||||
IsReply = false,
|
IsReply = isReply,
|
||||||
IsThread = false,
|
IsThread = false,
|
||||||
IsRetweet = isRetweet,
|
IsRetweet = isRetweet,
|
||||||
Media = null,
|
Media = null,
|
||||||
|
|
Loading…
Add table
Reference in a new issue