tweeter

package
v0.0.0-...-b3ee4c8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2017 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConsumerKey    string
	ConsumerSecret string
	ServerURL      string
	Database       *db.Connection
}

type Tweeter

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

Tweeter takes care of sending tweets at regularly scheduled intervals. In addition, the type may be used to interact with the Twitter API.

func New

func New(cfg *Config) *Tweeter

New creates a new tweeter instance from the specified configuration.

func (*Tweeter) Authorize

func (t *Tweeter) Authorize(a *db.Account) (string, string, string, error)

Authorize begins the authorization process for an account. The URL to redirect the user to and the temporary credentials are returned.

func (*Tweeter) Close

func (t *Tweeter) Close()

Close shuts down the tweeter.

func (*Tweeter) Complete

func (t *Tweeter) Complete(accessToken, accessSecret, verifier string) (string, string, error)

Complete finishes the OAuth process. The access token and secret are returned.

func (*Tweeter) Like

func (t *Tweeter) Like(a *db.Account, id int64) error

Like favorites the specified tweet.

func (*Tweeter) Mentions

func (t *Tweeter) Mentions(a *db.Account) ([]anaconda.Tweet, error)

Mentions returns recent mentions for the account.

func (*Tweeter) Reply

func (t *Tweeter) Reply(a *db.Account, id, text string) error

Tweet sends a tweet, optionally replying to a tweet with the specified ID.

func (*Tweeter) Trigger

func (t *Tweeter) Trigger(a *db.Account)

Trigger hints to the tweeter that a new tweet is available or forces an account to tweet its next queued item.

Jump to

Keyboard shortcuts

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