Documentation
¶
Overview ¶
Package ostatus implements queries that operate on statuses (tweets) using the Twitter API v1.1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Record the update as a reply to this tweet ID. This will be ignored // unless the update text includes an @mention of the author of that tweet. InReplyTo string // Ask the server to automatically populate the reply target and mentions. AutoPopulateReply bool // User IDs to exclude when auto-populating mentions. AutoExcludeMentions []string // Optional tweet fields to report with a successful update. Optional types.TweetFields }
CreateOpts provides parameters for tweet creation. A nil *CreateOpts provides zero values for all fields.
type Options ¶
type Options struct {
Optional types.TweetFields
}
Options provides parameters for tweet modification. A nil *Options provides zero values for all fields.
type Query ¶
Query is a query to post, delete, like, or retweet a status update.
func Create ¶
func Create(text string, opts *CreateOpts) Query
Create constructs a status update ("tweet") with the given text. This query requires user-context authorization.
API: 1.1/statuses/update.json
func Delete ¶
Delete constructs a query to delete ("destroy") a tweet with the given ID. This query requires user-context authorization.
API: 1.1/statuses/destroy/:id.json
func Like ¶
Like constructs a query to like ("favorite") a tweet with the given ID. This query requires user-context authorization.
API: 1.1/favorites/create.json
func Retweet ¶
Retweet constructs a query to retweet a tweet with the given ID. This query requires user-context authorization.
API: 1.1/statuses/retweet/:id.json
func Unlike ¶
Unlike constructs a query to un-like ("unfavorite") a tweet with the given ID. This query requires user-context authorization.
API: 1.1/favorites/destroy.json
type TimelineOpts ¶
type TimelineOpts struct { // Look up the user by ID instead of by username. ByID bool // The maximum number of results to return (limit 200). // If zero, use the server default. MaxResults int // Exclude replies from the reported timeline. ExcludeReplies bool // Include native retweets in the reported timeline. IncludeRetweets bool // Include entities in the response. IncludeEntities bool // If set, return results with IDs greater than this (exclusive). SinceID string // If set, return results with IDs smaller than this (exclusive). UntilID string // Optional tweet fields to report with the result. Optional types.TweetFields }
TimelineOpts provides parameters for timeline queries. A nil *TimelineOpts provides zero values for all fields.
type TimelineQuery ¶
TimelineQuery is a query to fetch a timeline of tweets.
func HomeTimeline ¶
func HomeTimeline(id string, opts *TimelineOpts) TimelineQuery
HomeTimeline constructs a query for the specified user's home timeline. This request requres user-context authorization.
API: 1.1/statuses/home_timeline.json
func MentionsTimeline ¶
func MentionsTimeline(id string, opts *TimelineOpts) TimelineQuery
MentionsTimeline constructs a query for the user's mentions timeline. This request requires user-context authorization.
API: 1.1/statuses/mentions_timeline.json
func UserTimeline ¶
func UserTimeline(id string, opts *TimelineOpts) TimelineQuery
UserTimeline constructs a query for the specified user's timeline.
API: 1.1/statuses/user_timeline.json