Filters are now separate structures to include a product or not based
on their own set of properties. For now, include and exclude filters
are supported. They take a regex as an argument and include a product
if the regex matches (or doesn't match) the product name. This commit
will allow us to create new filters on product like on a price range.
Signed-off-by: Julien Riou <julien@riou.xyz>
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 introduces the Amazon support with calls to the Product Advertising
API (PA API). For now, I was only able to use the "www.amazon.fr" marketplace.
I will add more marketplaces when my Amazon Associate accounts will be
validated.
Signed-off-by: Julien Riou <julien@riou.xyz>
- Rename "Parser" to "URLParser"
- Make "Parse" function generic
- Rename "crawlShop" function to "handleProducts"
- Reduce "handleProducts" footprint a little bit
Signed-off-by: Julien Riou <julien@riou.xyz>
Add `browser_address` configuration setting to define where is the headless
browser instead of relying on the default value.
Signed-off-by: Julien Riou <julien@riou.xyz>
Local stores are set with an "storeid" param in the query string of the URL
and by a "storeSelected" cookie to avoid garbage in the query strings for
further requests. As product URL is a unique key in the database, Micro Center
is able to handle an URL with the store ID for every product. We can add this
storeid in the list of URLs to parse and job done. Every single Micro Center
local store are parsable.
Signed-off-by: Julien Riou <julien@riou.xyz>
As a good start, only the "shippable items" are parsed. Next enhancement would
be to configure local shops.
Signed-off-by: Julien Riou <julien@riou.xyz>
- new language: go
- new shops: cybertek.fr, mediamarkt.ch
- deprecated shops: alternate.be, minershop.eu
- improved database transaction management
- better web parsing library (ferret, requires headless chrome browser)
- include or exclude products by applying regex on their names
- check for PID file to avoid running the bot twice
- hastags are now configurable
Signed-off-by: Julien Riou <julien@riou.xyz>