search

package
v0.0.0-...-abc52a7 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBot

func NewBot(c chan []string) reddit.Bot

NewBot creates a new reddit bot instance

func NewConfig

func NewConfig() graw.Config

NewConfig creates a new graw configuration

func NewSpider

func NewSpider() *gocrawl.Crawler

NewSpider returns a new crawler

func RunBot

func RunBot(bot reddit.Bot, cfg graw.Config)

RunBot runs the bot

func RunSpider

func RunSpider(c *gocrawl.Crawler, seed string)

RunSpider starts the web crawler at seed

Types

type Announcer

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

Announcer is a handler for Run

func (*Announcer) Comment

func (a *Announcer) Comment(post *reddit.Comment) error

Comment implements Comment handler

func (*Announcer) Post

func (a *Announcer) Post(post *reddit.Post) error

Post is called when there is a new post

type Extender

type Extender struct {
	*gocrawl.DefaultExtender
}

Extender defines the extension methods required by the crawler

func (*Extender) Filter

func (e *Extender) Filter(ctx *gocrawl.URLContext, isVisited bool) bool

Filter only crawled reddit pages

func (*Extender) Visit

func (e *Extender) Visit(ctx *gocrawl.URLContext, res *http.Response, doc *goquery.Document) (interface{}, bool)

Visit does the scraping work

Jump to

Keyboard shortcuts

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