Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ingredient ¶
Ingredient information
type IngredientSchema ¶
type IngredientSchema struct { // the root element where all the ingredients will be listed Root string // the element container for each ingredient within the root Row string // if name is zero-value, it would take the text value within the row Name string Unit string Amount string }
IngredientSchema to help drill down the list
type Recipe ¶
type Recipe struct { Title string Author string DatePublished time.Time Ingredients []Ingredient }
TODO Move Recipe and Ingredient to a shared schema package Recipe extracted from the website base on the given schema mapping
type RecipePage ¶
type RecipePage struct { URL string // contains filtered or unexported fields }
RecipePage to interact with the screen scrapping
func NewRecipePage ¶
func NewRecipePage(url string) RecipePage
NewRecipePage creates an object with colly scaffolded and ready to be used
type Schema ¶
type Schema struct { Title string Author string DatePublished string Ingredient IngredientSchema }
Schema to map css selector to the recipe properties, where key = recipe detail and value = css selector Will have matching properties to `Recipe` struct. If the page does not contain any of those details, an empty value (string zero-value) should be placed.
Click to show internal directories.
Click to hide internal directories.