@@ -10,6 +10,14 @@ type (
1010 Name string
1111 }
1212
13+ // Url represents a URL with display, expanded, and index data.
14+ Url struct {
15+ DisplayURL string `json:"display_url"`
16+ ExpandedURL string `json:"expanded_url"`
17+ URL string `json:"url"`
18+ Indices []int `json:"indices"`
19+ }
20+
1321 // Photo type.
1422 Photo struct {
1523 ID string
@@ -91,6 +99,25 @@ type (
9199 GIFs []GIF
92100 }
93101
102+ ExtendedMedia struct {
103+ IDStr string `json:"id_str"`
104+ MediaURLHttps string `json:"media_url_https"`
105+ ExtSensitiveMediaWarning struct {
106+ AdultContent bool `json:"adult_content"`
107+ GraphicViolence bool `json:"graphic_violence"`
108+ Other bool `json:"other"`
109+ } `json:"ext_sensitive_media_warning"`
110+ Type string `json:"type"`
111+ URL string `json:"url"`
112+ VideoInfo struct {
113+ Variants []struct {
114+ Type string `json:"content_type"`
115+ Bitrate int `json:"bitrate"`
116+ URL string `json:"url"`
117+ } `json:"variants"`
118+ } `json:"video_info"`
119+ }
120+
94121 legacyTweet struct {
95122 ConversationIDStr string `json:"conversation_id_str"`
96123 CreatedAt string `json:"created_at"`
@@ -105,35 +132,15 @@ type (
105132 Type string `json:"type"`
106133 URL string `json:"url"`
107134 } `json:"media"`
108- URLs []struct {
109- ExpandedURL string `json:"expanded_url"`
110- URL string `json:"url"`
111- } `json:"urls"`
135+ URLs []Url `json:"urls"`
112136 UserMentions []struct {
113137 IDStr string `json:"id_str"`
114138 Name string `json:"name"`
115139 ScreenName string `json:"screen_name"`
116140 } `json:"user_mentions"`
117141 } `json:"entities"`
118142 ExtendedEntities struct {
119- Media []struct {
120- IDStr string `json:"id_str"`
121- MediaURLHttps string `json:"media_url_https"`
122- ExtSensitiveMediaWarning struct {
123- AdultContent bool `json:"adult_content"`
124- GraphicViolence bool `json:"graphic_violence"`
125- Other bool `json:"other"`
126- } `json:"ext_sensitive_media_warning"`
127- Type string `json:"type"`
128- URL string `json:"url"`
129- VideoInfo struct {
130- Variants []struct {
131- Type string `json:"content_type"`
132- Bitrate int `json:"bitrate"`
133- URL string `json:"url"`
134- } `json:"variants"`
135- } `json:"video_info"`
136- } `json:"media"`
143+ Media []ExtendedMedia `json:"media"`
137144 } `json:"extended_entities"`
138145 IDStr string `json:"id_str"`
139146 InReplyToStatusIDStr string `json:"in_reply_to_status_id_str"`
@@ -210,15 +217,10 @@ type (
210217 Description string `json:"description"`
211218 Entities struct {
212219 Description struct {
213- Urls []interface {} `json:"urls"`
220+ Urls []Url `json:"urls"`
214221 } `json:"description"`
215222 URL struct {
216- Urls []struct {
217- DisplayURL string `json:"display_url"`
218- ExpandedURL string `json:"expanded_url"`
219- URL string `json:"url"`
220- Indices []int `json:"indices"`
221- } `json:"urls"`
223+ Urls []Url `json:"urls"`
222224 } `json:"url"`
223225 } `json:"entities"`
224226 FastFollowersCount int `json:"fast_followers_count"`
0 commit comments