webscraper

package
v0.0.0-...-a622e30 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTML_M_CONTENT   = "//div[@id='content']"
	HTML_M_BLURB     = "//div[@class='text shrinkable']/p"
	HTML_M_BLURB_ALT = "/div[@class='text']"
	HTML_M_TITLE     = "//h1//span[@class='item']/text()"
	HTML_M_AUTHORS   = "//div[@class='authors']//a[not(following-sibling::span[@class='data'])]"
	HTML_M_SERIES    = "//h1//span[@class='item']//a"
)

Variables

View Source
var ErrScraperNotFound = errors.New("scraper not found")
View Source
var Registry = make(map[string]Scraper)

Functions

func RegisterScraper

func RegisterScraper(p Scraper)

Types

type Link struct {
	Value string
	Url   string
}

type Metadata

type Metadata struct {
	Blurb   string
	Authors []Link
	Series  []SeriesLink
	Title   string
	Tags    []string
}

func Scrape

func Scrape(url string) (Metadata, error)

type Moly

type Moly struct {
}

func (*Moly) CheckUrl

func (m *Moly) CheckUrl(url string) bool

func (*Moly) Name

func (m *Moly) Name() string

func (*Moly) Scrape

func (m *Moly) Scrape(url string) (Metadata, error)

type Scraper

type Scraper interface {
	Name() string
	Scrape(url string) (Metadata, error)
	CheckUrl(url string) bool
}
type SeriesLink struct {
	Value    string
	Url      string
	Seqno    int
	HasSeqno bool
}

Jump to

Keyboard shortcuts

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