From 6b8d72d3f6650164ff177a26843d145966a053c7 Mon Sep 17 00:00:00 2001 From: Adam Blaschke Date: Thu, 3 Apr 2014 19:18:20 -0400 Subject: [PATCH 1/2] Added Entities to user objects to get full URL. --- twitter_entities.go | 10 ++++++ twitter_user.go | 79 +++++++++++++++++++++++---------------------- 2 files changed, 50 insertions(+), 39 deletions(-) diff --git a/twitter_entities.go b/twitter_entities.go index 29a62a0..6215edc 100644 --- a/twitter_entities.go +++ b/twitter_entities.go @@ -1,5 +1,14 @@ package anaconda +type UrlEntity struct { + Urls []struct { + Indices []int + Url string + Display_url string + Expanded_url string + } +} + type Entities struct { Hashtags []struct { Indices []int @@ -11,6 +20,7 @@ type Entities struct { Display_url string Expanded_url string } + Url UrlEntity User_mentions []struct { Name string Indices []int diff --git a/twitter_user.go b/twitter_user.go index c172840..2b592be 100644 --- a/twitter_user.go +++ b/twitter_user.go @@ -1,43 +1,44 @@ package anaconda type User struct { - ContributorsEnabled bool `json:"contributors_enabled"` - CreatedAt string `json:"created_at"` - DefaultProfile bool `json:"default_profile"` - DefaultProfileImage bool `json:"default_profile_image"` - Description string `json:"description"` - FavouritesCount int `json:"favourites_count"` - FollowRequestSent bool `json:"follow_request_sent"` - FollowersCount int `json:"followers_count"` - Following bool `json:"following"` - FriendsCount int `json:"friends_count"` - GeoEnabled bool `json:"geo_enabled"` - Id int64 `json:"id"` - IdStr string `json:"id_str"` - IsTranslator bool `json:"is_translator"` - Lang string `json:"lang"` - ListedCount int64 `json:"listed_count"` - Location string `json:"location"` - Name string `json:"name"` - Notifications bool `json:"notifications"` - ProfileBackgroundColor string `json:"profile_background_color"` - ProfileBackgroundImageURL string `json:"profile_background_image_url"` - ProfileBackgroundImageUrlHttps string `json:"profile_background_image_url_https"` - ProfileBackgroundTile bool `json:"profile_background_tile"` - ProfileImageURL string `json:"profile_image_url"` - ProfileImageUrlHttps string `json:"profile_image_url_https"` - ProfileLinkColor string `json:"profile_link_color"` - ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` - ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` - ProfileTextColor string `json:"profile_text_color"` - ProfileUseBackgroundImage bool `json:"profile_use_background_image"` - Protected bool `json:"protected"` - ScreenName string `json:"screen_name"` - ShowAllInlineMedia bool `json:"show_all_inline_media"` - Status *Tweet `json:"status"` // Only included if the user is a friend - StatusesCount int64 `json:"statuses_count"` - TimeZone string `json:"time_zone"` - URL string `json:"url"` - UtcOffset int `json:"utc_offset"` - Verified bool `json:"verified"` + ContributorsEnabled bool `json:"contributors_enabled"` + CreatedAt string `json:"created_at"` + DefaultProfile bool `json:"default_profile"` + DefaultProfileImage bool `json:"default_profile_image"` + Description string `json:"description"` + FavouritesCount int `json:"favourites_count"` + FollowRequestSent bool `json:"follow_request_sent"` + FollowersCount int `json:"followers_count"` + Following bool `json:"following"` + FriendsCount int `json:"friends_count"` + GeoEnabled bool `json:"geo_enabled"` + Id int64 `json:"id"` + IdStr string `json:"id_str"` + IsTranslator bool `json:"is_translator"` + Lang string `json:"lang"` + ListedCount int64 `json:"listed_count"` + Location string `json:"location"` + Name string `json:"name"` + Notifications bool `json:"notifications"` + ProfileBackgroundColor string `json:"profile_background_color"` + ProfileBackgroundImageURL string `json:"profile_background_image_url"` + ProfileBackgroundImageUrlHttps string `json:"profile_background_image_url_https"` + ProfileBackgroundTile bool `json:"profile_background_tile"` + ProfileImageURL string `json:"profile_image_url"` + ProfileImageUrlHttps string `json:"profile_image_url_https"` + ProfileLinkColor string `json:"profile_link_color"` + ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` + ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` + ProfileTextColor string `json:"profile_text_color"` + ProfileUseBackgroundImage bool `json:"profile_use_background_image"` + Protected bool `json:"protected"` + ScreenName string `json:"screen_name"` + ShowAllInlineMedia bool `json:"show_all_inline_media"` + Status *Tweet `json:"status"` // Only included if the user is a friend + StatusesCount int64 `json:"statuses_count"` + TimeZone string `json:"time_zone"` + URL string `json:"url"` + UtcOffset int `json:"utc_offset"` + Verified bool `json:"verified"` + Entities *Entities `json:"entities"` } From 55e24504a5e02d5c93f2a861386ef06db312d902 Mon Sep 17 00:00:00 2001 From: Adam Blaschke Date: Tue, 13 Dec 2016 15:00:02 -0500 Subject: [PATCH 2/2] Add Description Url Entities --- twitter_entities.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twitter_entities.go b/twitter_entities.go index e838cfa..5cceabd 100644 --- a/twitter_entities.go +++ b/twitter_entities.go @@ -10,7 +10,8 @@ type UrlEntity struct { } type Entities struct { - Hashtags []struct { + Description UrlEntity + Hashtags []struct { Indices []int Text string }