scrape

package
v0.0.0-...-9dc091a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDir

func CreateDir(name string)

func DownloadImage

func DownloadImage(url string, id string, subreddit string) error

func GetSubRedditData

func GetSubRedditData(doc *html.Node, attr string) string

func GetSubRedditPost

func GetSubRedditPost(doc *html.Node, id string) string

func JPEGHandler

func JPEGHandler(f *os.File, res *http.Response) error

func LinkGrabber

func LinkGrabber(value string, subreddit string) ([]string, error)

func PNGHandler

func PNGHandler(f *os.File, res *http.Response) error

func ParseDate

func ParseDate(date string) (string, error)

func RandomUserAgent

func RandomUserAgent() string

func Scroller

func Scroller(target string) (string, error)

func SendRequests

func SendRequests(value string) (string, error)

func Unique

func Unique(intSlice []string) []string

func WritetoJSON

func WritetoJSON(data []Data, file_name string) error

Types

type Data

type Data struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	Post         string `json:"post"`
	Upvotes      string `json:"upvotes"`
	Author       string `json:"author"`
	Image        string `json:"image"`
	PostType     string `json:"post_type"`
	Flair        string `json:"flair"`
	NSFW         bool   `json:"nsfw"`
	CommentCount string `json:"commentscount"`
	CreatedAt    string `json:"created_at"`
}

func Start

func Start(subreddit string, limit int, category string) (data []Data, err error)

func StartWithoutImages

func StartWithoutImages(subreddit string, limit int, category string) (data []Data, err error)

Jump to

Keyboard shortcuts

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