hayden

package module
v0.0.0-...-fcd4958 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 9 Imported by: 0

README

hayden

Go Report Card GoDoc Build Status

Hayden scrapes the web for things and send you a webhook when it finds them. This was initially made to scrape for PS5s being on sale.

Documentation

Index

Constants

View Source
const (
	Service = "hayden"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log           *zap.SugaredLogger `json:"-"`
	DefaultHook   string             `json:"default-hook"`
	DefaultPeriod int                `json:"default-period"`
}

func (*Config) Find

func (cfg *Config) Find(ctx context.Context, target *url.URL, search string) (bool, error)

type ConfigFile

type ConfigFile struct {
	Config  *Config   `json:"config"`
	Targets []*Target `json:"targets"`
}

func ParseConfigFile

func ParseConfigFile(stream []byte) (*ConfigFile, error)

func (*ConfigFile) ScrapeTargets

func (cf *ConfigFile) ScrapeTargets(ctx context.Context) error

type Target

type Target struct {
	URL    string `json:"url"`
	Text   string `json:"text"`
	Invert bool   `json:"invert"`
	Hook   string `json:"hook,omitempty"`
	Period int    `json:"period,omitempty"`
}

func (*Target) Scan

func (t *Target) Scan(ctx context.Context, cfg *Config) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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