twitter

package
v0.0.0-...-ac5bdac Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBody

func ParseBody(resp *http.Response) ([]byte, error)

func Request

func Request(httpClient *http.Client, apiURL string) ([]byte, error)

Types

type Client

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

Client represents the data required to connect to the Twitter API

func NewClient

func NewClient(settings *Settings) *Client

NewClient creates and returns a new Twitter client

func (*Client) Tweets

func (client *Client) Tweets() []Tweet

Tweets returns a list of tweets of a user

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 Tweet

type Tweet struct {
	User      User   `json:"user"`
	Text      string `json:"text"`
	CreatedAt string `json:"created_at"`
}

func (*Tweet) Created

func (tweet *Tweet) Created() time.Time

func (*Tweet) PrettyCreatedAt

func (tweet *Tweet) PrettyCreatedAt() string

func (*Tweet) String

func (tweet *Tweet) String() string

func (*Tweet) Username

func (tweet *Tweet) Username() string

type User

type User struct {
	ScreenName string `json:"screen_name"`
}

User is used as part of the Tweet struct to get user information

type Widget

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

func NewWidget

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

func (*Widget) Refresh

func (widget *Widget) Refresh()

Refresh is called on the interval and refreshes the data

Jump to

Keyboard shortcuts

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