twitterstats

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client contains state that allows stats to be fetched about a list of Twitter users

func NewClient

func NewClient(settings *Settings) *Client

NewClient creates a new twitterstats client that contains an OAuth2 HTTP client which can be used

func (*Client) GetStats

func (client *Client) GetStats() []TwitterStats

GetStats Returns a slice of `TwitterStats` structs for each username in `client.screenNames` in the same order of `client.screenNames`

func (*Client) GetStatsForUser

func (client *Client) GetStatsForUser(username string) TwitterStats

GetStatsForUser Fetches stats for a single user. If there is an error fetching or parsing the response from the Twitter API, an empty stats struct will be returned.

type Settings

type Settings struct {
	*cfg.Common
	// contains filtered or unexported fields
}

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

type TwitterStats

type TwitterStats struct {
	FollowerCount int64 `json:"followers_count"`
	TweetCount    int64 `json:"statuses_count"`
}

TwitterStats Represents a stats snapshot for a single Twitter user at a point in time

type Widget

type Widget struct {
	view.TextWidget
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(tviewApp *tview.Application, redrawChan chan bool, _ *tview.Pages, settings *Settings) *Widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

Jump to

Keyboard shortcuts

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