twitterscraper

package module
v0.0.0-...-5eb2b8a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTrends

func GetTrends() ([]string, error)

GetTrends return list of trends.

func GetTweets

func GetTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *Result

GetTweets returns channel with tweets for a given user.

func SearchTweets

func SearchTweets(ctx context.Context, query string, maxTweetsNbr int) <-chan *Result

SearchTweets returns channel with tweets for a given search query

Types

type Profile

type Profile struct {
	Avatar         string
	Banner         string
	Biography      string
	Birthday       string
	FollowersCount int
	FollowingCount int
	IsPrivate      bool
	IsVerified     bool
	Joined         *time.Time
	LikesCount     int
	Location       string
	Name           string
	TweetsCount    int
	URL            string
	UserID         string
	Username       string
	Website        string
}

Profile of twitter user.

func GetProfile

func GetProfile(username string) (Profile, error)

GetProfile return parsed user profile.

type Result

type Result struct {
	Tweet
	Error error
}

Result of scrapping.

type Tweet

type Tweet struct {
	Hashtags     []string
	HTML         string
	ID           string
	IsPin        bool
	IsRetweet    bool
	Likes        int
	PermanentURL string
	Photos       []string
	Replies      int
	Retweets     int
	Text         string
	TimeParsed   time.Time
	Timestamp    int64
	URLs         []string
	UserID       string
	Username     string
	Videos       []Video
}

Tweet type.

func FetchSearchTweets

func FetchSearchTweets(query, nextCursor string) ([]*Tweet, string, error)

FetchSearchTweets gets tweets for a given search query, via the Twitter frontend API

func FetchTweets

func FetchTweets(user string, last string) ([]*Tweet, error)

FetchTweets gets tweets for a given user, via the Twitter frontend API.

type Video

type Video struct {
	ID      string
	Preview string
}

Video type.

Jump to

Keyboard shortcuts

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