twitter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

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

func NewBrowser

func NewBrowser(cfg *BrowserConfig) *Browser

func (*Browser) Posts

func (c *Browser) Posts(parent context.Context, page string, n int, withFollowers bool) ([]*Post, error)

func (*Browser) Start

func (b *Browser) Start(parent context.Context) error

func (*Browser) Stop

func (c *Browser) Stop() error

Stop closes the browser.

type BrowserConfig

type BrowserConfig struct {
	Wait        time.Duration
	Remote      string
	Proxy       string
	Profile     bool
	CookieStore CookieStore
	BinPath     string
	Headless    bool
}

type CookieStore

type CookieStore interface {
	GetCookie(context.Context) (string, error)
	SetCookie(context.Context, string) error
}

func NewCookieStore

func NewCookieStore(path string) CookieStore

type Post

type Post struct {
	ID            string    `json:"id"`
	Text          string    `json:"text"`
	Time          time.Time `json:"time"`
	UserID        string    `json:"user_id"`
	UserName      string    `json:"user_name"`
	UserFollowers int       `json:"user_followers"`
	Comments      int       `json:"comments"`
	Retweets      int       `json:"retweets"`
	Likes         int       `json:"likes"`
	Views         int       `json:"views"`
}

Jump to

Keyboard shortcuts

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