twitter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTweets

func GetTweets(username string) <-chan *twitterscraper.Result

func GetUserID

func GetUserID(username string) (string, error)

func Register

func Register() error

Register registers a new user to twitter.

Types

type Bot

type Bot struct {
	Username string
	// contains filtered or unexported fields
}

func NewUser

func NewUser(id int, username, password string, timeout int) (Bot, context.CancelFunc, error)

NewUser creates a new instance of user struct

func (Bot) EnsureCommented

func (b Bot) EnsureCommented(tweetURL, nick, text string)

EnsureCommented ensures that specified tweet is commented by the bot

func (Bot) EnsureFollowed

func (b Bot) EnsureFollowed(who string) error

EnsureFollowed makes shure, the profile is followed by the bot

func (Bot) EnsureFollowingReciprocity

func (b Bot) EnsureFollowingReciprocity(who string) error

TBD EnsureFollowingReciprocity makes shure makes shure the bot only follows those who follows the bot

func (Bot) EnsureLiked

func (b Bot) EnsureLiked(tweetURL string)

EnsureLiked unsures that specified tweet is liked by the bot

func (Bot) EnsureRetweeted

func (b Bot) EnsureRetweeted(tweetURL string)

EnsureRetweeted unsures that specified tweet is retweeted by the bot

func (Bot) Follow

func (b Bot) Follow(who string) error

Follow will open and follow selected Twitter account.

func (Bot) IsCommented

func (b Bot) IsCommented(tweetURL, nick string) (bool, error)

IsCommented checks whether specified tweet was already commented by the bot

func (Bot) IsFollowed

func (b Bot) IsFollowed(who string) (bool, error)

IsFollowed checks whether user is followed by a bot

func (Bot) IsFollowing

func (b Bot) IsFollowing(who string) (bool, error)

TBD IsFollowing checks whether the user follows the bot

func (Bot) IsLiked

func (b Bot) IsLiked(tweetURL string) (bool, error)

IsLiked checks whether specified tweet is liked by the bot

func (Bot) IsLoggedIn

func (b Bot) IsLoggedIn() (bool, error)

IsLoggedIn checks whether the bot is logged in in the browser

func (Bot) IsProfileAccessible

func (b Bot) IsProfileAccessible() (bool, error)

IsProfileAccessible checks whether profile is not blocked

func (Bot) IsRetweeted

func (b Bot) IsRetweeted(tweetURL string) (bool, error)

IsRetweeted checks whether specified tweet is already retweeted by the bot

func (Bot) IsTweetAvailable

func (b Bot) IsTweetAvailable(tweetURL string) (bool, error)

IsAvailable navigates to tweets URL and checks whether the tweet is available

func (b Bot) LogCommentLink(tweetURL string)

func (Bot) Login

func (b Bot) Login() error

Login logs user into the Twitter

func (Bot) MaybeLike

func (b Bot) MaybeLike(tweetURL string, chance float32)

MaybeLike likes the post with chance of 0.0-1.0.

func (Bot) MaybeRetweet

func (b Bot) MaybeRetweet(tweetURL string, chance float32)

MaybeRetweet retweets the post with chance of 0.0-1.0.

func (Bot) Open

func (b Bot) Open() error

Open opens the profile and leaves it open for manual tweaks

func (Bot) Post

func (b Bot) Post(text string) error

Post sends a new tweet

func (Bot) Reply

func (b Bot) Reply(tweetURL, text string)

Reply makes sure that the bot replied to the tweet with the text

func (Bot) ReplyFromTemplate

func (b Bot) ReplyFromTemplate(tweetURL, template string)

ReplyFromTemplate makes sure that bot replied to the tweet with text generated from template

func (Bot) TrollReply

func (b Bot) TrollReply(tweetURL string)

TrollReply makes sure that the bot reacts to the tweet with some trolly comment

func (Bot) Unfollow

func (b Bot) Unfollow(who string) error

TBD Unfollow will open and unfollow selected Twitter account.

Jump to

Keyboard shortcuts

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