tweets

package
v0.0.0-...-b615745 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Twitter

type Twitter struct {
	shared.Config

	TwitterAuth  *TwitterAuth
	GraphQLToken string
}

Twitter contains the context needed for working with twitter.

func (*Twitter) CacheRandomTweets

func (t *Twitter) CacheRandomTweets(ctx context.Context) error

CacheRandomTweets gets random tweets from graphql, and if we are missing their data, gets it from twitter and uploads to graphql.

func (*Twitter) CacophonyCron

func (t *Twitter) CacophonyCron(ctx context.Context) error

CacophonyCron triggers the cacophony cron.

func (*Twitter) GetTweet

func (t *Twitter) GetTweet(ctx context.Context, id int64) (*twitter.Tweet, error)

GetTweet gets a single tweet.

func (*Twitter) SaveUserTweets

func (t *Twitter) SaveUserTweets(ctx context.Context) error

SaveUserTweets gets a users timeline and uploads it to graphql.

func (*Twitter) UploadTweet

func (t *Twitter) UploadTweet(ctx context.Context, tw twitter.Tweet) error

UploadTweet uploads a single tweet.

type TwitterAuth

type TwitterAuth struct {
	ConsumerKey    string
	ConsumerSecret string
	AccessToken    string
	AccessSecret   string
}

TwitterAuth holds the auth strings needed to talk to twitter.

func (*TwitterAuth) Validate

func (t *TwitterAuth) Validate(ctx context.Context, log *zap.SugaredLogger) (*twitter.Client, *twitter.User, error)

Validate gets a twitter client and the current twitter user.

Jump to

Keyboard shortcuts

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