twitter

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MPL-2.0 Imports: 15 Imported by: 1

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(bearerToken string, 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 {
	// 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 {
	wtf.KeyboardWidget
	wtf.MultiSourceWidget
	wtf.TextWidget
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget

func (*Widget) HelpText added in v0.10.0

func (widget *Widget) HelpText() string

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