parsers

package
v0.0.0-...-e27359b Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package parsers provides an interface for parsing html pages (or other data) for recipes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllRecipesDotComParser

type AllRecipesDotComParser struct{}

AllRecipesDotComParser is a RecipeParser for the site allrecipes.com.

func (AllRecipesDotComParser) GetDirections

func (a AllRecipesDotComParser) GetDirections(data []byte) []string

GetDirections gets the directions of the recipe.

func (AllRecipesDotComParser) GetIngredients

func (a AllRecipesDotComParser) GetIngredients(data []byte) []string

GetIngredients gets the ingredients of the recipe.

func (AllRecipesDotComParser) GetName

func (a AllRecipesDotComParser) GetName(data []byte) string

GetName gets the title of the recipe.

type MelsKitchenCafeDotComParser

type MelsKitchenCafeDotComParser struct{}

MelsKitchenCafeDotComParser is a RecipeParser for the site melskitchencafe.com.

func (MelsKitchenCafeDotComParser) GetDirections

func (a MelsKitchenCafeDotComParser) GetDirections(data []byte) []string

GetDirections gets the directions of the recipe.

func (MelsKitchenCafeDotComParser) GetIngredients

func (a MelsKitchenCafeDotComParser) GetIngredients(data []byte) []string

GetIngredients gets the ingredients of the recipe.

func (MelsKitchenCafeDotComParser) GetName

func (a MelsKitchenCafeDotComParser) GetName(data []byte) string

GetName gets the title of the recipe.

type RecipeParser

type RecipeParser interface {
	// GetName gets the title of the recipe.
	GetName(data []byte) string

	// GetIngredients returns a list of ingredients for the recipe.
	GetIngredients(data []byte) []string

	// GetDirections returns a list of directions for the recipe.
	GetDirections(data []byte) []string
}

RecipeParser is an interface that cleans information from data about a recipe.

func GetParserForURL

func GetParserForURL(URL string) (RecipeParser, error)

GetParserForURL attempts to match the given URL with a known recipe parser.

Jump to

Keyboard shortcuts

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