twitter

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RateLimitDuration = 15 * time.Minute
)

Variables

This section is empty.

Functions

func GetRateLimitDuration added in v0.8.2

func GetRateLimitDuration() time.Duration

func LoadCookies

func LoadCookies(scraper *twitterscraper.Scraper, account *TwitterAccount, baseDir string) error

func RandomSleep added in v0.8.4

func RandomSleep()

func SaveCookies

func SaveCookies(scraper *twitterscraper.Scraper, account *TwitterAccount, baseDir string) error

func ScrapeFollowersForProfile

func ScrapeFollowersForProfile(baseDir string, username string, count int) ([]*twitterscraper.Profile, error)

func ScrapeTweetsProfile

func ScrapeTweetsProfile(baseDir string, username string) (twitterscraper.Profile, error)

Types

type Scraper added in v0.8.2

type Scraper struct {
	*twitterscraper.Scraper
}

func NewScraper added in v0.8.2

func NewScraper(account *TwitterAccount, cookieDir string) *Scraper

func (*Scraper) IsLoggedIn added in v0.8.2

func (s *Scraper) IsLoggedIn() bool

func (*Scraper) Login added in v0.8.2

func (scraper *Scraper) Login(username, password string, twoFACode ...string) error

func (*Scraper) Logout added in v0.8.2

func (scraper *Scraper) Logout() error

type TweetResult added in v0.5.1

type TweetResult struct {
	Tweet *twitterscraper.Tweet
	Error error
}

func ScrapeTweetsByQuery

func ScrapeTweetsByQuery(baseDir string, query string, count int) ([]*TweetResult, error)

type TwitterAccount added in v0.8.2

type TwitterAccount struct {
	Username         string
	Password         string
	TwoFACode        string
	RateLimitedUntil time.Time
}

type TwitterAccountManager added in v0.8.2

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

func NewTwitterAccountManager added in v0.8.2

func NewTwitterAccountManager(accounts []*TwitterAccount) *TwitterAccountManager

func (*TwitterAccountManager) GetNextAccount added in v0.8.2

func (manager *TwitterAccountManager) GetNextAccount() *TwitterAccount

func (*TwitterAccountManager) MarkAccountRateLimited added in v0.8.2

func (manager *TwitterAccountManager) MarkAccountRateLimited(account *TwitterAccount)

Jump to

Keyboard shortcuts

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