Skip to content

Commit

Permalink
added the entity URL images (g8rswimmer#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
g8rswimmer authored Dec 11, 2022
1 parent f1d01da commit cec1b95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion v2/_examples/tweets/lookup/tweet-lookup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
}
opts := twitter.TweetLookupOpts{
Expansions: []twitter.Expansion{twitter.ExpansionEntitiesMentionsUserName, twitter.ExpansionAuthorID},
TweetFields: []twitter.TweetField{twitter.TweetFieldCreatedAt, twitter.TweetFieldConversationID, twitter.TweetFieldAttachments},
TweetFields: []twitter.TweetField{twitter.TweetFieldCreatedAt, twitter.TweetFieldConversationID, twitter.TweetFieldAttachments, twitter.TweetFieldEntities},
}

fmt.Println("Callout to tweet lookup callout")
Expand Down
24 changes: 16 additions & 8 deletions v2/common_obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ type EntityAnnotationObj struct {
// EntityURLObj contains details about text recognized as a URL.
type EntityURLObj struct {
EntityObj
URL string `json:"url"`
ExpandedURL string `json:"expanded_url"`
DisplayURL string `json:"display_url"`
Status int `json:"status"`
Title string `json:"title"`
Description string `json:"description"`
UnwoundURL string `json:"unwound_url"`
MediaKey string `json:"media_key"`
URL string `json:"url"`
ExpandedURL string `json:"expanded_url"`
DisplayURL string `json:"display_url"`
Status int `json:"status"`
Title string `json:"title"`
Description string `json:"description"`
UnwoundURL string `json:"unwound_url"`
MediaKey string `json:"media_key"`
Images []EntityURLImageObj `json:"images"`
}

// EntityURLImageObj defines the array of images that are associated with the entity URL object
type EntityURLImageObj struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
}

// EntityTagObj contains details about text recognized as a tag
Expand Down

0 comments on commit cec1b95

Please sign in to comment.