scraper

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package scraper implements the logic to extract a recipe from a website.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("domain is not implemented")

ErrNotImplemented is the error used when the website is not supported.

Functions

This section is empty.

Types

type IScraper added in v1.1.0

type IScraper interface {
	Scrape(url string, files services.FilesService) (models.RecipeSchema, error)
}

IScraper is the scraper's interface.

type Scraper added in v1.1.0

type Scraper struct {
	HTTP services.HTTP
}

Scraper represents the IScraper's implementation.

func NewScraper added in v1.1.0

func NewScraper(client services.HTTPClient) *Scraper

NewScraper creates a new Scraper.

func (*Scraper) Scrape added in v1.1.0

func (s *Scraper) Scrape(rawURL string, files services.FilesService) (models.RecipeSchema, error)

Scrape extracts the recipe from the given URL. An error will be returned when the URL cannot be parsed.

Source Files

Jump to

Keyboard shortcuts

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