twitter

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	// the account creation date
	CreatedAt string `json:"createdAt"`
	// the user description
	Description string `json:"description"`
	// the follower count
	Followers int64 `json:"followers,string"`
	// the user id
	Id int64 `json:"id,string"`
	// The user's profile picture
	ImageUrl string `json:"imageUrl"`
	// the user's location
	Location string `json:"location"`
	// display name of the user
	Name string `json:"name"`
	// if the account is private
	Private bool `json:"private"`
	// the username
	Username string `json:"username"`
	// if the account is verified
	Verified bool `json:"verified"`
}

type SearchRequest

type SearchRequest struct {
	// number of tweets to return. default: 20
	Limit int32 `json:"limit"`
	// the query to search for
	Query string `json:"query"`
}

type SearchResponse

type SearchResponse struct {
	// the related tweets for the search
	Tweets []Tweet `json:"tweets"`
}

type TimelineRequest

type TimelineRequest struct {
	// number of tweets to return. default: 20
	Limit int32 `json:"limit"`
	// the username to request the timeline for
	Username string `json:"username"`
}

type TimelineResponse

type TimelineResponse struct {
	// The recent tweets for the user
	Tweets []Tweet `json:"tweets"`
}

type Trend

type Trend struct {
	// name of the trend
	Name string `json:"name"`
	// the volume of tweets in last 24 hours
	TweetVolume int64 `json:"tweetVolume,string"`
	// the twitter url
	Url string `json:"url"`
}

type TrendsRequest

type TrendsRequest struct {
}

type TrendsResponse

type TrendsResponse struct {
	// a list of trending topics
	Trends []Trend `json:"trends"`
}

type Tweet

type Tweet struct {
	// time of tweet
	CreatedAt string `json:"createdAt"`
	// number of times favourited
	FavouritedCount int64 `json:"favouritedCount,string"`
	// id of the tweet
	Id int64 `json:"id,string"`
	// number of times retweeted
	RetweetedCount int64 `json:"retweetedCount,string"`
	// text of the tweet
	Text string `json:"text"`
	// username of the person who tweeted
	Username string `json:"username"`
}

type TwitterService

type TwitterService struct {
	// contains filtered or unexported fields
}

func NewTwitterService

func NewTwitterService(token string) *TwitterService

func (*TwitterService) Search

func (t *TwitterService) Search(request *SearchRequest) (*SearchResponse, error)

Search for tweets with a simple query

func (*TwitterService) Timeline

func (t *TwitterService) Timeline(request *TimelineRequest) (*TimelineResponse, error)

Get the timeline for a given user

func (*TwitterService) Trends

func (t *TwitterService) Trends(request *TrendsRequest) (*TrendsResponse, error)

Get the current global trending topics

func (*TwitterService) User

func (t *TwitterService) User(request *UserRequest) (*UserResponse, error)

Get a user's twitter profile

type UserRequest

type UserRequest struct {
	// the username to lookup
	Username string `json:"username"`
}

type UserResponse

type UserResponse struct {
	// The requested user profile
	Profile *Profile `json:"profile"`
	// the current user status
	Status *Tweet `json:"status"`
}

Jump to

Keyboard shortcuts

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