scraper

package
v0.0.0-...-0c73132 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedMeta

type FeedMeta struct {
	Title       string
	Description string
	Author      string
	URL         string
	Items       []string
}

FeedMeta contains metadata about a feed

type Result

type Result struct {
	URL  string
	Name string
}

Result contains a single feed element

type Scraper

type Scraper interface {
	DiscoverFeed(ctx context.Context, u *url.URL) (*FeedMeta, error)
	ScrapeFeed(ctx context.Context, u *url.URL) ([]Result, error)
}

Scraper defines the methods used when interacting with a feed

func New

func New(c *client.Client) (Scraper, error)

New returns a new scraper instance

Jump to

Keyboard shortcuts

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