diff --git a/timeline.go b/timeline.go index 3b9f575..be8cdfe 100644 --- a/timeline.go +++ b/timeline.go @@ -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) diff --git a/types.go b/types.go index f5f2f48..6055453 100644 --- a/types.go +++ b/types.go @@ -23,6 +23,7 @@ type ( Likes int PermanentURL string Photos []string + Place *Place QuotedStatus *Tweet Replies int Retweets int @@ -74,6 +75,19 @@ type ( Verified bool `json:"verified"` } + Place struct { + ID string `json:"id"` + PlaceType string `json:"place_type"` + Name string `json:"name"` + FullName string `json:"full_name"` + CountryCode string `json:"country_code"` + Country string `json:"country"` + BoundingBox struct { + Type string `json:"type"` + Coordinates [][][]float64 `json:"coordinates"` + } `json:"bounding_box"` + } + fetchProfileFunc func(query string, maxProfilesNbr int, cursor string) ([]*Profile, string, error) fetchTweetFunc func(query string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error) )