Core

package
v0.0.0-...-3693da1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client *http.Client = new(http.Client)
)

Functions

func BoolPointer

func BoolPointer(b bool) *bool

func FormatTweets

func FormatTweets(format string, tweets []Tweet)

func FormatTweetsCSV

func FormatTweetsCSV(tweets []Tweet)

func FormatTweetsJSON

func FormatTweetsJSON(tweets []Tweet)

func GetTweets

func GetTweets(w http.ResponseWriter, r *http.Request)

func LimitReached

func LimitReached(tweetLimit int, tweetStorage []Tweet) bool

LimitReached checks if the user specified a tweet limit, and if the tweet limit has been reached.

func Main

func Main(args *InputParser.Arguments)

func NewRouter

func NewRouter() *http.ServeMux

func Request

func Request(args *InputParser.Arguments, cursor *string) io.ReadCloser

func StartBackend

func StartBackend() error

Types

type GetTweetsPostData

type GetTweetsPostData struct {
	Query      string `json:"query"`
	Format     string `json:"format"`
	Instance   string `json:"instance"`
	TweetLimit string `json:"tweet_limit"`
}

type Tweet

type Tweet struct {
	ID        int
	URL       string
	Text      string
	Username  string
	Fullname  string
	Timestamp string
}

func Scrape

func Scrape(responseBody io.ReadCloser, args *InputParser.Arguments, cursor *string) (bool, []Tweet)

func ScrapeHandler

func ScrapeHandler(responseBody io.ReadCloser, args *InputParser.Arguments, cursor *string) (bool, []Tweet)

Jump to

Keyboard shortcuts

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