twitter

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	// User details
	ID           int64     `firestore:"id" json:"id"`
	Username     string    `firestore:"username" json:"username"`
	Name         string    `firestore:"name" json:"name"`
	Description  string    `firestore:"description" json:"description"`
	ProfileImage string    `firestore:"profile_image" json:"profile_image"`
	CreatedAt    time.Time `firestore:"created_at" json:"created_at"`

	// counts
	PostCount     int `firestore:"post_count" json:"post_count"`
	FaveCount     int `firestore:"fave_count" json:"fave_count"`
	FriendCount   int `firestore:"friend_count" json:"friend_count"`
	FollowerCount int `firestore:"followers_count" json:"followers_count"`
	ListedCount   int `firestore:"listed_count" json:"listed_count"`
}

Author represents tweet author.

type Config

type Config struct {
	ConsumerKey       string `json:"consumer_key"`
	ConsumerSecret    string `json:"consumer_secret"`
	AccessTokenKey    string `json:"access_key"`
	AccessTokenSecret string `json:"access_secret"`
}

Config represens store configuration.

type SearchCriteria

type SearchCriteria struct {
	SinceID          int64     `json:"since"`
	Query            string    `json:"query"`
	Lang             string    `json:"lang"`
	Latest           bool      `json:"latest"`
	HasLink          bool      `json:"links"`
	IncludeRT        bool      `json:"retweets"`
	MinPosts         int64     `json:"posts"`
	MinFriends       int64     `json:"friends"`
	MinFollowers     int64     `json:"followers"`
	MaxFollowerRatio float64   `json:"ratio"`
	Updated          time.Time `json:"updated"`
	EmailTo          string    `json:"email-to"`
}

SearchCriteria represnets Twitter search criteria.

func (*SearchCriteria) GetID

func (s *SearchCriteria) GetID() string

GetID returns id based on the query hash.

type Tweet

type Tweet struct {
	ID            string    `json:"id_str"`
	CriteriaID    string    `json:"criteria_id"`
	ExecutedOn    string    `json:"executed_on"`
	CreatedAt     time.Time `json:"created_at"`
	FavoriteCount int       `json:"favorite_count"`
	ReplyCount    int       `json:"reply_count"`
	RetweetCount  int       `json:"retweet_count"`
	IsRT          bool      `json:"is_rt"`
	Text          string    `json:"text"`
	Author        *Author   `json:"author"`
}

Tweet represents simple tweet

func (*Tweet) GetID

func (t *Tweet) GetID() string

GetID returns the tweet ID.

type Twitter

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

Twitter represents simple Twitter client

func New

func New(val string, w *worker.Worker) (*Twitter, error)

New creates a new Twitter

func (*Twitter) GetTweetCount

func (t *Twitter) GetTweetCount() int

GetTweetCount returns the number of tweets

func (*Twitter) Send added in v0.2.7

func (t *Twitter) Send(ctx context.Context, q *SearchCriteria) error

Send returns matching tweets

Jump to

Keyboard shortcuts

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