Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB = []byte("DB")
DB the root bucket name
View Source
var Entries = []byte("ENTRIES")
Entries the data bucket name
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct { *colly.Collector // extend colly.Collector // contains filtered or unexported fields }
Collector data collector
func NewCollector ¶
NewCollector return an extended colly.Collector configured just the way Skrapa likes it based on the given script
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter parse scripts
func (Exporter) ExportJSON ¶
ExportJSON export database as JSON
type PipelineItem ¶
type PipelineItem struct { Selector string `toml:"selector"` Action string `toml:"action"` Attribute string `toml:"attr"` Column string `toml:"column,omitempty"` VisitOnce bool `toml:"visit_once,omitempty"` }
PipelineItem models a Skrapa pipeline item
type Script ¶
type Script struct { Main struct { URL string `toml:"url"` File string `toml:"file"` Format string `toml:"format"` UserAgent string `toml:"user_agent,omitempty"` Delay int `toml:"delay,omitempty"` AllowedDomains []string `toml:"allowed_domains,omitempty"` } `toml:"main"` Pipeline []*PipelineItem `toml:"pipeline"` }
Script models the Skrapa TOML config
type ScriptParser ¶
type ScriptParser struct{}
ScriptParser parse scripts
func NewScriptParser ¶
func NewScriptParser() *ScriptParser
NewScriptParser return a new script parser
Click to show internal directories.
Click to hide internal directories.