Archived
1
0
Fork 0
Commit graph

47 commits

Author SHA1 Message Date
47c8a8ace9
Add PostgreSQL support (#23)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-06 10:33:24 +02:00
b6f23d4bd5
Unify case in help
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-06 09:25:15 +02:00
81258ed935
Keep track and remove stale products
Products not updated since a while are not supposed to stay in the database nor
exposed via the API. This commit automatically updates all detected products
with the current date and adds a "retention" flag (number of days) to remove old
products. This flag is disabled by default.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-06 09:22:22 +02:00
7c2c1032cb
Make the linter happy
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-01 17:57:17 +02:00
ab5abcd171
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>
2021-04-01 17:50:50 +02:00
5f69b8435b
Remove auto increment from primary key
Because it's implicit with gorm.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-01 17:13:17 +02:00
305b3eeb76
Enable replies on Twitter and Telegram
By default, when a product is available, a notification is sent. When that same
product is not available, a reply is sent to the original message. With tons of
notifications, replies might be seen as flooding. This commit adds an option to
explicitly enable replies on Twitter and Telegram notifiers. By default, reply
messages are disabled.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-01 13:14:00 +02:00
26eb0af9ea
Release 0.5.0
- Add Amazon support (#3)

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-01 13:02:52 +02:00
5ac5f78ae2
Add Amazon support (#3)
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>
2021-04-01 12:59:16 +02:00
f994093baf
Release 0.4.0
- Add HTTP API

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-30 18:01:54 +02:00
17a88265c6
Add HTTP API
Add `-api` mode to start the HTTP API with the following routes:
- /health
- /shops
- /shops/:id
- /products
- /products/:id

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-30 18:00:12 +02:00
3122e59325
Release 0.3.1
- Use markdown in Telegram

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-30 08:59:39 +02:00
9ef7ac928e
Use markdown in Telegram
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-24 12:51:58 +01:00
93a37f2f89
Release 0.3.0
- Add Telegram Messenger notifications
- Prepare for new parsers

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-24 09:37:13 +01:00
0a9ae46d19
Add Telegram Messenger notifications
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-24 09:35:37 +01:00
e67ab63ca8
Prepare for new parsers
- 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>
2021-03-23 09:00:10 +01:00
9269d59380
Release 0.2.3
- Add Versus Gamers support (#12)
- Add STEG support (#10)
- Update the Twitter reply
- Add Dockerfile

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-23 07:58:44 +01:00
2681e4a427
Add Versus Gamers support (#12)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-19 17:03:11 +01:00
42b8f50068
Add STEG support (#10)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-16 15:29:28 +01:00
77230bd0a4
Update the Twitter reply
Twitter reply message updated to comply with the "And It's Gone" meme from 2009:
https://knowyourmeme.com/memes/and-its-gone

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-12 12:01:07 +01:00
21e40e9079
Add Dockerfile
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-09 10:59:26 +01:00
f7d10a00e5
Release 0.2.2
- Add newegg support (#14)
- Truncate too long product names for Twitter
- Configure headless browser address
- Bugfix include and exclude regexes

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-06 07:54:14 +01:00
e47795baf1
Remove leftover query file
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-02 12:39:18 +01:00
384ad0beef
Add newegg support (#14)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-02 12:37:12 +01:00
92b991c042
Add newegg support (#14)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-02 09:02:23 +01:00
443fbd9106
Remove useless comment in Twitter tests
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-02 09:01:18 +01:00
9692da6852
Truncate too long product names for Twitter
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-02 08:56:47 +01:00
45025def65
Configure headless browser address
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>
2021-03-01 13:11:58 +01:00
6f002f007d
Bugfix include and exclude regexes
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-03-01 09:06:00 +01:00
14576cde0e
Release 0.2.1
Features:
 - Add Micro Center support (#2)
 - Replace strings with regexp for Twitter hashtags

Bugfixes:
 - Use array of key/value for Twitter hashtags (#1)

Cleanup:
 - Remove useless compileRegex function

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-28 15:35:10 +01:00
0902b13705
Add USD currency to price format on Twitter
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-28 15:33:59 +01:00
2afd36584b
Add store support for Micro Center (#2)
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>
2021-02-28 15:11:31 +01:00
42f79c03d4
Add Micro Center support (#2)
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>
2021-02-28 10:33:28 +01:00
5e19efbad8
Replace strings with regexp for Twitter hashtags
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-28 09:45:19 +01:00
4342f65211
Use array of key/value for Twitter hashtags (#1)
With Go, maps are not ordered the way they are declared. Keys can be read at any
order. When a pattern is too large ("rtx 3060"), when placed first, it can match
a name of another product ("rtx 3060 ti"). When placed second, the good hashtag
is chosen. This commit uses an array of maps because arrays are ordered.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-27 18:34:13 +01:00
40b0ba999a
Remove useless compileRegex function
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-27 15:14:21 +01:00
3a4aba93e5
Release 0.2.0
- 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>
2021-02-27 08:10:43 +01:00
31bcbc51dd
Commit more often
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-18 17:32:49 +01:00
e424b3bf98
Bugfix tweet error log
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-11 14:59:49 +01:00
91c5d07ef2
Add AMD RX 5700 XT hashtags 2021-01-19 17:30:06 +01:00
2c7189d7fc
Add mineshop support 2021-01-13 16:48:03 +01:00
29c26167dc
Remove new line in the README 2021-01-13 08:16:51 +01:00
b8abbe67f4
Lowercase arguments descriptions 2020-12-30 15:29:55 +01:00
7e351a79f6
Improve crawlers mapping 2020-12-30 15:25:36 +01:00
39eaf21c0a
Crawl websites concurrently 2020-12-30 15:15:34 +01:00
0b0d2727e8
Initial release 2020-12-27 18:27:07 +01:00
89c7ec935b
Initial commit 2020-12-27 18:23:36 +01:00