olists

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package olists implements queries that operate on lists using the Twitter API v1.1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FollowOpts

type FollowOpts struct {
	// Look up following by user ID rather than username.
	ByID bool

	// A pagination token provided by the server.
	PageToken string

	// The number of results to return per page (maximum 200).
	// If zero, use the server default (20).
	PerPage int

	// Optional user fields to report with a successful update.
	Optional types.UserFields
}

FollowOpts provides parameters for follower/following queries. A nil *FollowOpts provides zero values for all fields.

type ListOpts

type ListOpts struct {
	// A pagination token provided by the server.
	PageToken string

	// The number of results to return per page (maximum 200).
	// If zero, use the server default (20).
	PerPage int

	// Optional user fields to report with a successful update.
	Optional types.UserFields
}

ListOpts provides parameters for list queries. A nil *ListOpts provides zero values for all fields.

type Query

type Query struct {
	*jape.Request
	// contains filtered or unexported fields
}

Query is a query for list memberships.

func Followers

func Followers(user string, opts *FollowOpts) Query

Followers constructs a query for the followers of a user.

API: 1.1/followers/list

func Following

func Following(user string, opts *FollowOpts) Query

Following constructs a query for the "friends" of a user, which are those accounts the user is following.

API: 1.1/friends/list

func Members

func Members(listID string, opts *ListOpts) Query

Members constructs a query for the members of a list.

API: 1.1/lists/members

func Subscribers

func Subscribers(listID string, opts *ListOpts) Query

Subscribers constructs a query for the subscribers to a list.

API: 1.1/lists/subscribers

func (Query) HasMorePages

func (q Query) HasMorePages() bool

HasMorePages reports whether the query has more pages to fetch. This is true for a freshly-constructed query, and for an invoked query where the server not reported a next-page token.

func (Query) Invoke

func (q Query) Invoke(ctx context.Context, cli *twitter.Client) (*Reply, error)

Invoke executes the query and returns the matching users.

func (Query) ResetPageToken

func (q Query) ResetPageToken()

ResetPageToekn resets (clears) the query's current page token. Subsequently invoking the query will then fetch the first page of results.

type Reply

type Reply = ocall.UsersReply

A Reply is the response from a Query.

Jump to

Keyboard shortcuts

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