Archived
1
0
Fork 0

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:
Julien Riou 2021-04-01 17:50:50 +02:00
parent 5f69b8435b
commit ab5abcd171
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
4 changed files with 34 additions and 42 deletions

View file

@ -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