Support for tweets with geolocation

Close #36
This commit is contained in:
Alexander Sheiko 2021-09-13 17:01:30 +03:00
parent 422fe9c097
commit 93068ddae5
2 changed files with 19 additions and 0 deletions

View file

@ -42,6 +42,7 @@ type timeline struct {
} `json:"media"`
} `json:"extended_entities"`
InReplyToStatusIDStr string `json:"in_reply_to_status_id_str"`
Place Place `json:"place"`
ReplyCount int `json:"reply_count"`
RetweetCount int `json:"retweet_count"`
RetweetedStatusIDStr string `json:"retweeted_status_id_str"`
@ -165,6 +166,10 @@ func (timeline *timeline) parseTweet(id string) *Tweet {
tw.Timestamp = tm.Unix()
}
if tweet.Place.ID != "" {
tw.Place = &tweet.Place
}
if tweet.QuotedStatusIDStr != "" {
tw.IsQuoted = true
tw.QuotedStatus = timeline.parseTweet(tweet.QuotedStatusIDStr)