Documentation
¶
Index ¶
Constants ¶
View Source
const DateFormat = "Mon Jan _2 15:04:05 -0700 2006"
DateFormat is the timestamp format used by the Twitter v1.1 API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entities ¶
type Entities struct { URLs []struct { Span []int `json:"indices"` URL string `json:"url"` Expanded string `json:"expanded_url"` Display string `json:"display_url"` } `json:"urls"` Mentions []struct { Span []int `json:"indices"` Username string `json:"screen_name"` } `json:"user_mentions"` }
Entities encodes a subset of API v1.1 Tweet entities.
func (*Entities) ToEntitiesV2 ¶
ToEntitiesV2 converts o into an approximately equivalent API v2 value.
type Tweet ¶
type Tweet struct { CreatedAt DateTime `json:"created_at"` ID string `json:"id_str"` // N.B. the "id" field is a number Text string `json:"text"` FullText string `json:"full_text"` // requires tweet_mode=extended Source string `json:"source"` // in HTML anchor form Truncated bool `json:"truncated"` InReplyToStatus string `json:"in_reply_to_status_id_str"` QuotedStatusID string `json:"quoted_status_id_str"` InReplyToUser string `json:"in_reply_to_user_id_str"` Sensitive bool `json:"possibly_sensitive"` Language string `json:"lang"` Entities *Entities `json:"entities"` // Public metrics LikeCount int `json:"favorite_count"` // note name difference QuoteCount int `json:"quote_count"` ReplyCount int `json:"reply_count"` RetweetCount int `json:"retweet_count"` // Author information (we only need the ID) User *struct { ID string `json:"id_str"` // N.B. the "id" field is a number } `json:"user"` }
Tweet captures a subset of the fields of the v1.1 API Tweet object, as needed to populate some of the essential fields of a v2 Tweet.
See https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/overview/tweet-object
type User ¶
type User struct { CreatedAt DateTime `json:"created_at"` Description string `json:"description"` FuzzyLocation string `json:"location"` ID string `json:"id_str"` // N.B. the "id" field is a number Name string `json:"name"` ProfileImageURL string `json:"profile_image_url_https"` ProfileURL string `json:"url"` Protected bool `json:"protected"` Username string `json:"screen_name"` Verified bool `json:"verified"` Entities struct { URL *Entities `json:"urls"` Desc *Entities `json:"description"` } `json:"entities"` // Public metrics FollowersCount int `json:"followers_count"` FollowingCount int `json:"friends_count"` ListedCount int `json:"listed_count"` TweetCount int `json:"statuses_count"` }
User captures a subset of the fields of the v1.1 API User object, as needed to populate some of the essential fields of a v2 User.
See https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/overview/user-object
Click to show internal directories.
Click to hide internal directories.