twtr

package module
v0.0.0-...-f1cac1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2017 License: MIT Imports: 12 Imported by: 20

README

twtr

Build Status Go Report Card codecov GoDoc MIT License

Installation

Install and update with go get github.com/bgpat/twtr

Examples

REST API
consumer := twtr.NewCredentials(consumerKey, consumerSecret)
token := twtr.NewCredentials(accessToken, accessSecret)
client := twtr.NewClient(consumer, token)

// account/verify_credentials
user, resp, err := client.VerifyCredentials(nil)
Get OAuth Token
	consumer := twtr.NewCredentials(consumerKey, consumerSecret)
	client := twtr.NewClient(consumer, nil)

	url, _ := client.RequestTokenURL("https://401.jp/")
	fmt.Println(url)

	var verifier string
	fmt.Scan(&verifier)
	client.GetAccessToken(verifier)

	user, _, err := client.GetUser(&twtr.Params{"screen_name": "Twitter"})
	if err != nil {
		fmt.Println("error:", err)
		return
	}
	fmt.Println("user:", user)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSettings

type AccountSettings struct {
	AllowContributorRequest   string           `json:"allow_contributor_request"`
	AllowDMsFrom              string           `json:"allow_dms_from"`
	AllowDMGroupsFrom         string           `json:"allow_dm_groups_from"`
	AlwaysUseHTTPS            bool             `json:"always_use_https"`
	DiscoverableByEmail       bool             `json:"discoverable_by_email"`
	DiscoverableByMobilePhone bool             `json:"discoverable_by_mobile_phone"`
	DisplaySensitiveMedia     bool             `json:"display_sensitive_media"`
	GeoEnabled                bool             `json:"geo_enabled"`
	Language                  string           `json:"language"`
	Protected                 bool             `json:"protected"`
	ScreenName                string           `json:"screen_name"`
	ShowAllInlineMedia        bool             `json:"show_all_inline_media"`
	SleepTime                 AccountSleepTime `json:"sleep_time"`
	TimeZone                  TimeZone         `json:"time_zone"`
	TranslatorType            string           `json:"translator_type"`
	TrendLocation             []TrendLocation  `json:"trend_location"`
	UseCookiePersonalization  bool             `json:"use_cookie_personalization"`
}

type AccountSleepTime

type AccountSleepTime struct {
	Enabled   bool `json:"enabled"`
	EndTime   int  `json:"end_time"`
	StartTime int  `json:"start_time"`
}

type Client

type Client struct {
	OAuthClient   oauth.Client
	AccessToken   *Credentials
	RequestToken  *Credentials
	URLFormat     string
	UserStreamURL string
}

func NewClient

func NewClient(consumer, token *Credentials) *Client

func (*Client) AddListMember

func (c *Client) AddListMember(params *Params) (*List, *Response, error)

func (*Client) AddListMembers

func (c *Client) AddListMembers(params *Params) (*List, *Response, error)

func (*Client) Block

func (c *Client) Block(params *Params) (*User, *Response, error)

Block blocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline (unless retweeted by another user). If a follow or friend relationship exists it is destroyed. https://dev.twitter.com/rest/reference/post/blocks/create

func (*Client) CreateList

func (c *Client) CreateList(params *Params) (*List, *Response, error)

func (*Client) DeleteList

func (c *Client) DeleteList(params *Params) (*List, *Response, error)

func (*Client) DeleteListMember

func (c *Client) DeleteListMember(params *Params) (*List, *Response, error)

func (*Client) DeleteListMembers

func (c *Client) DeleteListMembers(params *Params) (*List, *Response, error)

func (*Client) Favorite

func (c *Client) Favorite(params *Params) (*Tweet, *Response, error)

Favorite favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. https://dev.twitter.com/rest/reference/post/favorites/create

func (*Client) Follow

func (c *Client) Follow(params *Params) (*User, *Response, error)

Follow allows the authenticating users to follow the user specified in the ID parameter. https://dev.twitter.com/rest/reference/post/friendships/create

func (*Client) GET

func (c *Client) GET(path string, params *Params, data interface{}) (*Response, error)

func (*Client) GetAccessToken

func (c *Client) GetAccessToken(verifier string) error

func (*Client) GetAccountSettings

func (c *Client) GetAccountSettings(params *Params) (*AccountSettings, *Response, error)

func (*Client) GetBlockIDs

func (c *Client) GetBlockIDs(params *Params) (*UserIDs, *Response, error)

GetBlockIDs returns an array of numeric user ids the authenticating user is blocking. https://dev.twitter.com/rest/reference/get/blocks/ids

func (*Client) GetBlockList

func (c *Client) GetBlockList(params *Params) (*UserList, *Response, error)

GetBlockList returns a collection of user objects that the authenticating user is blocking. https://dev.twitter.com/rest/reference/get/blocks/list

func (*Client) GetCSRFToken

func (c *Client) GetCSRFToken(params *Params) (*Cookie, *Response, error)

GetCSRFToken returns auth/csrf_token

func (*Client) GetFavorites

func (c *Client) GetFavorites(params *Params) ([]Tweet, *Response, error)

GetFavorites returns the 20 most recent Tweets favorited by the authenticating or specified user. https://dev.twitter.com/rest/reference/get/favorites/list

func (*Client) GetFollowerIDs

func (c *Client) GetFollowerIDs(params *Params) (*UserIDs, *Response, error)

GetFollowerIDs returns a cursored collection of user IDs for every user following the specified user. https://dev.twitter.com/rest/reference/get/followers/ids

func (*Client) GetFollowerList

func (c *Client) GetFollowerList(params *Params) (*UserList, *Response, error)

GetFollowerList returns a cursored collection of user objects for users following the specified user. https://dev.twitter.com/rest/reference/get/followers/list

func (*Client) GetFriendFollowingIDs

func (c *Client) GetFriendFollowingIDs(params *Params) (*UserIDs, *Response, error)

GetFriendFollowingIDs returns a cursored collection of common friends' user ID.

func (*Client) GetFriendFollowingList

func (c *Client) GetFriendFollowingList(params *Params) (*UserList, *Response, error)

GetFriendFollowingList returns a cursored collection of common friends' user object.

func (*Client) GetFriendIDs

func (c *Client) GetFriendIDs(params *Params) (*UserIDs, *Response, error)

GetFriendIDs returns a cursored collection of user IDs for every user the specified user is following (otherwise known as their “friends”). https://dev.twitter.com/rest/reference/get/friends/ids

func (*Client) GetFriendList

func (c *Client) GetFriendList(params *Params) (*UserList, *Response, error)

GetFriendList returns a cursored collection of user objects for every user the specified user is following (otherwise known as their “friends”). https://dev.twitter.com/rest/reference/get/friends/list

func (*Client) GetFriendship

func (c *Client) GetFriendship(params *Params) (*Relationship, *Response, error)

GetFriendship returns detailed information about the relationship between two arbitrary users. https://dev.twitter.com/rest/reference/get/friendships/show

func (*Client) GetFriendships

func (c *Client) GetFriendships(params *Params) ([]Friendship, *Response, error)

GetFriendships returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. https://dev.twitter.com/rest/reference/get/friendships/lookup

func (*Client) GetIncomingFriendships

func (c *Client) GetIncomingFriendships(params *Params) (*UserIDs, *Response, error)

GetIncomingFriendships returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user. https://dev.twitter.com/rest/reference/get/friendships/incoming

func (*Client) GetList

func (c *Client) GetList(params *Params) (*List, *Response, error)

func (*Client) GetListMembers

func (c *Client) GetListMembers(params *Params) (*ListMembers, *Response, error)

func (*Client) GetLists

func (c *Client) GetLists(params *Params) ([]List, *Response, error)

func (*Client) GetNoRetweetFriendshipIDs

func (c *Client) GetNoRetweetFriendshipIDs(params *Params) ([]string, *Response, error)

GetNoRetweetFriendshipIDs eturns a collection of user_ids that the currently authenticated user does not want to receive retweets from. Use POST friendships/update to set the “no retweets” status for a given user account on behalf of the current user. https://dev.twitter.com/rest/reference/get/friendships/no_retweets/ids

func (*Client) GetOutgoingFriendships

func (c *Client) GetOutgoingFriendships(params *Params) (*UserIDs, *Response, error)

GetOutgoingFriendships returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request. https://dev.twitter.com/rest/reference/get/friendships/outgoing

func (*Client) GetRateLimitStatus

func (c *Client) GetRateLimitStatus(params *Params) (*RateLimitStatus, *Response, error)

func (*Client) GetUser

func (c *Client) GetUser(params *Params) (*User, *Response, error)

func (*Client) GetUserProfileBanner

func (c *Client) GetUserProfileBanner(params *Params) (*Images, *Response, error)

func (*Client) GetUsers

func (c *Client) GetUsers(params *Params) ([]User, *Response, error)

func (*Client) NewStreaming

func (c *Client) NewStreaming(method, urlStr string, params *Params) (*Streaming, error)

func (*Client) NewUserStream

func (c *Client) NewUserStream(params *Params) (*Streaming, error)

func (*Client) POST

func (c *Client) POST(path string, params *Params, data interface{}) (*Response, error)

func (*Client) ReportSpamUser

func (c *Client) ReportSpamUser(params *Params) (*User, *Response, error)

func (*Client) RequestTokenURL

func (c *Client) RequestTokenURL(callback string) (string, error)

func (*Client) SearchUsers

func (c *Client) SearchUsers(params *Params) ([]User, *Response, error)

func (*Client) Unblock

func (c *Client) Unblock(params *Params) (*User, *Response, error)

Unblock un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful. If relationships existed before the block was instated, they will not be restored. https://dev.twitter.com/rest/reference/post/blocks/destroy

func (*Client) Unfavorite

func (c *Client) Unfavorite(params *Params) (*Tweet, *Response, error)

Unfavorite un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful. https://dev.twitter.com/rest/reference/post/favorites/destroy

func (*Client) Unfollow

func (c *Client) Unfollow(params *Params) (*User, *Response, error)

Unfollow allows the authenticating user to unfollow the user specified in the ID parameter. https://dev.twitter.com/rest/reference/post/friendships/destroy

func (*Client) UpdateAccountSettings

func (c *Client) UpdateAccountSettings(params *Params) (*AccountSettings, *Response, error)

func (*Client) UpdateFriendship

func (c *Client) UpdateFriendship(params *Params) (*Relationship, *Response, error)

UpdateFriendship allows one to enable or disable retweets and device notifications from the specified user. https://dev.twitter.com/rest/reference/post/friendships/update

func (*Client) UpdateProfile

func (c *Client) UpdateProfile(params *Params) (*User, *Response, error)

UpdateProfile sets values that users are able to set under the "Account" tab of their settings page. https://dev.twitter.com/rest/reference/post/account/update_profile

func (*Client) UpdateTweet

func (c *Client) UpdateTweet(params *Params) (*Tweet, *Response, error)

func (*Client) VerifyCredentials

func (c *Client) VerifyCredentials(params *Params) (*User, *Response, error)
type Cookie struct {
	Path     string `json:"cookie_path"`
	Name     string `json:"cookie_name"`
	Value    string `json:"cookie_value"`
	Secure   bool   `json:"cookie_secure"`
	HTTPOnly bool   `json:"cookie_httponly"`
	Maxage   int64  `json:"cookie_maxage"`
	Domain   string `json:"cookie_domain"`
}

Cookie represents HTTP cookie

type Coordinates

type Coordinates struct {
	Coordinates [2]float64 `json:"coordinates"`
	Type        string     `json:"type"`
}

type Credentials

type Credentials struct {
	oauth.Credentials
}

func NewCredentials

func NewCredentials(token, secret string) *Credentials

type Cursor

type Cursor struct {
	PreviousCursor    int64  `json:"previous_cursor"`
	PreviousCursorStr string `json:"previous_cursor_str"`
	NextCursor        int64  `json:"next_cursor"`
	NextCursorStr     string `json:"next_cursor_str"`
}

type DirectMessage

type DirectMessage struct {
	ID
	CreatedAt           Time     `json:"created_at"`
	Entities            Entities `json:"entities"`
	Recipient           User     `json:"recipient"`
	RecipientID         int64    `json:"recipient_id"`
	RecipientScreenName string   `json:"recipient_screen_name"`
	Sender              User     `json:"sender"`
	SenderID            int64    `json:"sender_id"`
	SenderScreenName    string   `json:"sender_screen_name"`
	Text                string   `json:"text"`
}

type Entities

type Entities struct {
	Hashtags     []HashtagEntity     `json:"hashtags"`
	Media        []MediaEntity       `json:"media"`
	URLs         []URLEntity         `json:"urls"`
	UserMentions []UserMentionEntity `json:"user_mentions"`
	Symbols      []SymbolEntity      `json:"symbols"`
}

type Entity

type Entity struct {
	Indices [2]int `json:"indices"`
}

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type Errors

type Errors struct {
	Status     string  `json:"status"`
	StatusCode int     `json:"status_code"`
	Errors     []Error `json:"errors"`
}

func NewErrors

func NewErrors(r *http.Response) *Errors

func (*Errors) Error

func (e *Errors) Error() string

type Friendship

type Friendship struct {
	ID
	Name        string   `json:"name"`
	ScreenName  string   `json:"screen_name"`
	Connections []string `json:"connections"`
}

Friendship represent relationship of the authenticating user. Values for connections can be: following, following_requested, followed_by, none, blocking, muting. https://dev.twitter.com/rest/reference/get/friendships/lookup

type HashtagEntity

type HashtagEntity SymbolEntity

type ID

type ID struct {
	ID    int64  `json:"id"`
	IDStr string `json:"id_str"`
}

type Image

type Image struct {
	H   int    `json:"h"`
	W   int    `json:"w"`
	URL string `json:"url"`
}

type Images

type Images struct {
	Sizes map[string]Image `json:"sizes"`
}

type Limit

type Limit struct {
	Limit     int  `json:"limit"`
	Remaining int  `json:"remaining"`
	Reset     Time `json:"reset"`
}

type List

type List struct {
	ID
	Slug            string `json:"slug"`
	Name            string `json:"name"`
	CreatedAt       Time   `json:"created_at"`
	URI             string `json:"uri"`
	SubscriberCount int    `json:"subscriber_count"`
	MemberCount     int    `json:"member_count"`
	Mode            string `json:"mode"`
	FullName        string `json:"full_name"`
	Description     string `json:"description"`
	User            User   `json:"user"`
	Following       bool   `json:"following"`
}

type ListMembers

type ListMembers struct {
	Cursor
	Users []User `json:"users"`
}

type MediaEntity

type MediaEntity struct {
	URLEntity
	ID
	MediaURL      string           `json:"media_url"`
	MediaURLHttps string           `json:"media_url_https"`
	Sizes         MediaEntitySizes `json:"sizes"`
	Type          string           `json:"type"`
	VideoInfo     *VideoInfo       `json:"video_info"`
}

type MediaEntitySize

type MediaEntitySize struct {
	H      int    `json:"h"`
	Resize string `json:"resize"`
	W      int    `json:"w"`
}

type MediaEntitySizes

type MediaEntitySizes struct {
	Thumb  MediaEntitySize `json:"thumb"`
	Large  MediaEntitySize `json:"large"`
	Medium MediaEntitySize `json:"medium"`
	Small  MediaEntitySize `json:"small"`
}

type Params

type Params map[string]string

func (*Params) AddNextCursor

func (p *Params) AddNextCursor(cursor Cursor) *Params

func (*Params) AddPreviousCursor

func (p *Params) AddPreviousCursor(cursor Cursor) *Params

func (*Params) ParseURL

func (p *Params) ParseURL(urlStr string) string

func (*Params) ToURLValues

func (p *Params) ToURLValues() (u url.Values)

type Place

type Place struct {
	Attributes      map[string]string `json:"attributes"`
	BoundingBox     PlaceBoundingBox  `json:"bounding_box"`
	ContainedWithin []Place           `json:"contained_within"`
	Country         string            `json:"country"`
	CountryCode     string            `json:"country_code"`
	FullName        string            `json:"full_name"`
	Geometry        PlaceBoundingBox  `json:"geometry"`
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	PlaceType       string            `json:"place_type"`
	URL             string            `json:"url"`
}

type PlaceBoundingBox

type PlaceBoundingBox struct {
	Coordinates [][4][2]float64 `json:"coordinates"`
	Type        string          `json:"type"`
}

type RateLimitContext

type RateLimitContext struct {
	AccessToken string `json:"access_token"`
	Application string `json:"application"`
}

type RateLimitStatus

type RateLimitStatus struct {
	RateLimitContext RateLimitContext            `json:"rate_limit_context"`
	Resources        map[string]map[string]Limit `json:"resources"`
}

type Relationship

type Relationship struct {
	Relationship struct {
		Target struct {
			ID
			ScreenName string `json:"screen_name"`
			Following  bool   `json:"following"`
			FollowedBy bool   `json:"followed_by"`
		} `json:"target"`
		Source struct {
			ID
			CanDM                bool   `json:"can_dm"`
			Blocking             bool   `json:"blocking"`
			Muting               bool   `json:"muting"`
			AllReplies           bool   `json:"all_replies"`
			WantRetweets         bool   `json:"want_retweets"`
			MarkedSpam           bool   `json:"marked_spam"`
			ScreenName           string `json:"screen_name"`
			Following            bool   `json:"following"`
			FollowedBy           bool   `json:"followed_by"`
			NotificationsEnabled bool   `json:"notifications_enabled"`
		} `json:"source"`
	} `json:"relationship"`
}

Relationship represent relationship of between two arbitrary users. https://dev.twitter.com/rest/reference/get/friendships/show

type Response

type Response struct {
	*http.Response
	*Limit
}

func (*Response) ParseResponse

func (r *Response) ParseResponse(resp *http.Response) error

type Streaming

type Streaming struct {
	*http.Response
	Event chan interface{}
	Error chan error
	// contains filtered or unexported fields
}

func (*Streaming) Close

func (s *Streaming) Close()

func (*Streaming) Decode

func (s *Streaming) Decode() (interface{}, error)

func (*Streaming) Start

func (s *Streaming) Start()

func (*Streaming) Stop

func (s *Streaming) Stop()

type StreamingControlEvent

type StreamingControlEvent struct {
	Control struct {
		ControlURI string `json:"control_uri"`
	} `json:"control"`
}

type StreamingDeleteDirectMessageEvent

type StreamingDeleteDirectMessageEvent struct {
	Delete struct {
		DirectMessage StreamingDeletedObject `json:"direct_message"`
	} `json:"delete"`
}

type StreamingDeleteLocationEvent

type StreamingDeleteLocationEvent struct {
	ScrubGeo struct {
		UserID          int64  `json:"user_id"`
		UserIDStr       string `json:"user_id_str"`
		UpToStatusID    int64  `json:"up_to_status_id"`
		UpToStatusIDStr string `json:"up_to_status_id_str"`
	} `json:"scrub_geo"`
}

type StreamingDeleteTweetEvent

type StreamingDeleteTweetEvent struct {
	Delete struct {
		Status      StreamingDeletedObject `json:"status"`
		TimestampMS string                 `json:"timestamp_ms"`
	} `json:"delete"`
}

type StreamingDeletedObject

type StreamingDeletedObject struct {
	ID
	UserID    int64  `json:"user_id"`
	UserIDStr string `json:"user_id_str"`
}

type StreamingDirectMessageEvent

type StreamingDirectMessageEvent struct {
	DirectMessage DirectMessage `json:"direct_message"`
}

type StreamingDisconnectEvent

type StreamingDisconnectEvent struct {
	Disconnect struct {
		Code       int    `json:"code"`
		StreamName string `json:"stream_name"`
		Reason     string `json:"reason"`
	} `json:"disconnect"`
}

type StreamingEnvelopeEvent

type StreamingEnvelopeEvent struct {
	ForUser int64 `json:"for_user"`
	Message struct {
		Friends []int64 `json:"friends"`
	} `json:"message"`
}

type StreamingFriendsEvent

type StreamingFriendsEvent struct {
	Friends []int64 `json:"friends"`
}

type StreamingGeneralEvent

type StreamingGeneralEvent struct {
	Event        string      `json:"event"`
	Source       User        `json:"source"`
	Target       User        `json:"target"`
	TargetObject interface{} `json:"target_object"`
	CreatedAt    Time        `json:"created_at"`
}

type StreamingLimitEvent

type StreamingLimitEvent struct {
	Limit struct {
		Track int `json:"track"`
	} `json:"limit"`
}

type StreamingListEvent

type StreamingListEvent struct {
	StreamingGeneralEvent
	TargetObject List `json:"target_object"`
}

type StreamingStatusWithheldEvent

type StreamingStatusWithheldEvent struct {
	StatusWithheld StreamingWithheldObject `json:"status_withheld"`
}

type StreamingTweetEvent

type StreamingTweetEvent struct {
	StreamingGeneralEvent
	TargetObject Tweet `json:"target_object"`
}

type StreamingUserWithheldEvent

type StreamingUserWithheldEvent struct {
	UserWithheld StreamingWithheldObject `json:"user_withheld"`
}

type StreamingWarningEvent

type StreamingWarningEvent struct {
	Warning struct {
		Code        int    `json:"code"`
		Message     string `json:"message"`
		PercentFull int    `json:"percent_full"`
		UserID      int64  `json:"user_id"`
	} `json:"warning"`
}

type StreamingWithheldObject

type StreamingWithheldObject struct {
	ID                  int64    `json:"id"`
	UserID              int64    `json:"user_id"`
	WithheldInCountries []string `json:"withheld_in_countries"`
}

type SymbolEntity

type SymbolEntity struct {
	Entity
	Text string `json:"text"`
}

type Time

type Time struct {
	time.Time
}

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) ParseUnixTime

func (t *Time) ParseUnixTime(s string) error

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

type TimeZone

type TimeZone struct {
	Name       string `json:"name"`
	UTCOffset  int    `json:"utc_offset"`
	TZInfoName string `json:"tzinfo_name"`
}

type TrendLocation

type TrendLocation struct {
	Name        string         `json:"name"`
	CountryCode string         `json:"country_code"`
	URL         string         `json:"url"`
	WOEID       int            `json:"woeid"`
	PlaceType   TrendPlaceType `json:"placeType"`
	ParentID    int            `json:"parentid"`
	Country     string         `json:"country"`
}

type TrendPlaceType

type TrendPlaceType struct {
	Name string `json:"name"`
	Code int    `json:"code"`
}

type Tweet

type Tweet struct {
	ID
	Contributors         []int64                `json:"contributors"`
	Coordinates          *Coordinates           `json:"coordinates"`
	CreatedAt            Time                   `json:"created_at"`
	CurrentUserRetweet   ID                     `json:"current_user_retweet"`
	Entities             Entities               `json:"entities"`
	ExtendedEntities     *Entities              `json:"extended_entities"`
	FavoriteCount        *int                   `json:"favorite_count"`
	Favorited            *bool                  `json:"favorited"`
	FilterLevel          string                 `json:"filter_level"`
	Geo                  *interface{}           `json:"geo"`
	InReplyToScreenName  *string                `json:"in_reply_to_screen_name"`
	InReplyToStatusID    *int64                 `json:"in_reply_to_status_id"`
	InReplyToStatusIDStr *string                `json:"in_reply_to_status_id_str"`
	InReplyToUserID      *int64                 `json:"in_reply_to_user_id"`
	InReplyToUserIDStr   *string                `json:"in_reply_to_user_id_str"`
	Lang                 *string                `json:"lang"`
	Place                *Place                 `json:"place"`
	PossiblySensitive    *bool                  `json:"possibly_sensitive"`
	QuotedStatusID       *int64                 `json:"quoted_status_id"`
	QuotedStatusIDStr    *string                `json:"quoted_status_id_str"`
	QuotedStatus         *Tweet                 `json:"quoted_status"`
	Scopes               map[string]interface{} `json:"scopes"`
	RetweetCount         *int                   `json:"retweet_count"`
	Retweeted            bool                   `json:"retweeted"`
	RetweetedStatus      *Tweet                 `json:"retweeted_status"`
	Source               string                 `json:"source"`
	Text                 string                 `json:"text"`
	Truncated            bool                   `json:"truncated"`
	User                 User                   `json:"user"`
	WithheldCopyright    bool                   `json:"withheld_copyright"`
	WithheldInCountries  []string               `json:"withheld_in_countries"`
	WithheldScope        string                 `json:"withheld_scope"`
}

type URLEntity

type URLEntity struct {
	Entity
	DisplayURL  string `json:"display_url"`
	ExpandedURL string `json:"expanded_url"`
	URL         string `json:"url"`
}

type User

type User struct {
	ID
	ContributorsEnabled            bool     `json:"contributors_enabled"`
	CreatedAt                      Time     `json:"created_at"`
	DefaultProfile                 bool     `json:"default_profile"`
	DefaultProfileImage            bool     `json:"default_profile_image"`
	Description                    *string  `json:"description"`
	Entities                       Entities `json:"entities"`
	FavouritesCount                int      `json:"favourites_count"`
	FollowRequestSent              *bool    `json:"follow_request_sent"`
	Following                      *bool    `json:"following"`
	FollowersCount                 int      `json:"followers_count"`
	FriendsCount                   int      `json:"friends_count"`
	GeoEnabled                     bool     `json:"geo_enabled"`
	IsTranslator                   bool     `json:"is_translator"`
	Lang                           string   `json:"lang"`
	ListedCount                    int      `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"`
	ProfileBannerURL               string   `json:"profile_banner_url"`
	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"`
	StatusesCount                  int      `json:"statuses_count"`
	TimeZone                       *string  `json:"time_zone"`
	URL                            *string  `json:"url"`
	UTCOffset                      *int     `json:"utc_offset"`
	Verified                       bool     `json:"verified"`
	WithheldInCountries            string   `json:"withheld_in_countries"`
	WithheldScope                  string   `json:"withheld_scope"`
}

type UserIDs

type UserIDs struct {
	Cursor
	IDs []int64 `json:"ids"`
}

type UserList

type UserList struct {
	Cursor
	Users []User `json:"users"`
}

type UserMentionEntity

type UserMentionEntity struct {
	Entity
	ID
	Name       string `json:"name"`
	ScreenName string `json:"screen_name"`
}

type VideoInfo

type VideoInfo struct {
	AspectRatio    [2]int             `json:"aspect_ratio"`
	DurationMillis int                `json:"duration_millis"`
	Variants       []VideoInfoVariant `json:"variants"`
}

type VideoInfoVariant

type VideoInfoVariant struct {
	Bitrate     int    `json:"bitrate"`
	ContentType string `json:"content_type"`
	URL         string `json:"url"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL