plugins

package
v0.0.0-...-2ee099b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2014 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package plugins is a set of default pieces of functionality to use with the stevie-holdway/goatscrape package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicGetter

func BasicGetter(req *http.Request) (*http.Response, error)
func ExtractAllLinks(resp *http.Response) []string

ExtractAllLinks simply extracts all the <a href="<urL>"> </a> in a page provided that they aren't silly like a hash. It also expands relative links automagically.

func RandomiseUserAgent

func RandomiseUserAgent(req *http.Request)

RandomiseUserAgent fullfils the goscrape.PreRequestFunc type. It takes a http.Request and applies a random user agent to the 'User-Agent' header.

Types

type BasicLinkStore

type BasicLinkStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*BasicLinkStore) AddToCrawl

func (b *BasicLinkStore) AddToCrawl(link string)
func (b *BasicLinkStore) GetLinks(amount int) []string

func (*BasicLinkStore) MoreToCrawl

func (b *BasicLinkStore) MoreToCrawl() bool

func (*BasicLinkStore) MoveToCrawled

func (b *BasicLinkStore) MoveToCrawled(link string)

Jump to

Keyboard shortcuts

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