Select or create shop before parsing
A shop map was created to group URLs by shops and process them in order. Now that we have Amazon and each URL can be parsed independently, there is no need to group them anymore. Moreover, shops were passed as an argument to the handleProducts function. Shop name can be deduced by the parser itself. The parser has a reference to the database. The parser now select or create the shop before parsing products. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
5f69b8435b
commit
ab5abcd171
4 changed files with 34 additions and 42 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
type Parser interface {
|
||||
Parse() ([]*Product, error)
|
||||
String() string
|
||||
ShopName() (string, error)
|
||||
}
|
||||
|
||||
// filterInclusive returns a list of products matching the include regex
|
||||
|
|
Reference in a new issue