Archived
1
0
Fork 0
Commit graph

80 commits

Author SHA1 Message Date
d774ee8057
chore: End of life notice
Signed-off-by: Julien Riou <julien@riou.xyz>
2023-11-01 09:09:41 +01:00
0d5e90dd9e
fix(monitoring): Fix product ordering
Products were ordered by old update timestamp first. We need the recent
timestamps first.

Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-02 09:22:33 +02:00
3a8d0825a6
refactor(monitoring): Improve code and output
- Don't return when a shop is missing
- Make MonitoringResult more generic to handle messages

Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-02 09:11:24 +02:00
e7c18d048e
chore: Disable low-level database error messages
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-02 08:49:19 +02:00
0c81963131
fix: Make monitoring build
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-01 07:07:13 +02:00
94eb400a28
doc: Add comment on NvidiaFEParser (go-lint)
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-01 07:03:33 +02:00
3b392700d3
feat: Add -monitor option
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-09-01 07:02:18 +02:00
cb53106e1f
chore: Rename NVIDIA FE shop
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-07-23 08:56:07 +02:00
817c4e0f6e
chore: Release 0.7.0
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-07-22 19:35:45 +02:00
991880f1c9
feat: Add NVIDIA FE (#15)
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-07-22 19:34:20 +02:00
999018492e
feat: Use PostgreSQL 14 Docker image
Signed-off-by: Julien Riou <julien@riou.xyz>
2022-07-22 16:34:23 +02:00
d0d606419f
feat: Add limited cdiscount.com support (#31)
- Only the first products are parsed
- Notifications not sent because only available products are listed and
  the very first discovery doesn't send a notification to avoid false
  positives
- Products stay available forever unless there is a retention period
  configured because unavailable products are not listed

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-07-19 13:15:02 +02:00
2c0b972849
fix: exclude cybertek home page (#33)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-07-12 08:50:36 +02:00
bf1a389704
Release 0.6.1
- Implement an anti-flapping system (#27)

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-07-07 15:38:46 +02:00
563d5ff9a6
feat: anti-flapping
Send notifications only if the state duration is not instant. There are
a lot of replies with 0 seconds duration spamming channels.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-07-07 15:36:03 +02:00
fbe5e5f723
Release 0.6.0
* add price range filter (#26)
* auto-remove stale products (#30)
* create new thread when product is available again (#28)

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-23 02:43:11 +02:00
da532104f8
feat: add price range filter (#26)
To avoid scalpers' price, the bot now understand filters on prices
using a minimum and maximum value, in a currency and a pattern to
detect the model.

Example:
```
"price_ranges": [
  {"model": "3090", "max": 3000, "currency": "EUR"},
  {"model": "3080", "max": 1600, "currency": "EUR"},
  {"model": "3070", "max": 1200, "currency": "EUR"}
],
```

More details in README.md.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-23 02:40:03 +02:00
ba791435b7
feat: add filter on price range
WIP

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-20 18:03:45 +02:00
27d9f4976e
style: fix typo in filter_include.go
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-20 17:11:12 +02:00
48a763a90c
style: add comments on filters
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-20 17:07:56 +02:00
244c9f68e7
refactor: move filters out of parser
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>
2021-05-19 17:43:31 +02:00
b6feb2d656
Auto-remove stale products (#30)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-14 16:08:09 +02:00
d6ee2922d7
Create new thread when product is available again (#28)
Instead of spamming a twitter thread with generic replies confusing the
community because the original message was posted long time ago, the bot now
creates a new thread with all product information and an incrementing counter
for uniqueness.
2021-04-23 12:22:18 +02:00
c796cb20f2
Release 0.5.2
- Bugfix typo for compilation
- Handle Twitter duplicates (#20)
- Ignore *.bak files
- Bugfix asynchronous loop
- Add tests for utils.go
- Add MySQL support (#24)
- Bugfix Twitter foreign key
- Include chromium in docker-compose

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-15 15:27:55 +02:00
75ca25ffbb
Bugfix typo for compilation
Used logrus.Logf instead of logrus.Printf.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-15 15:27:46 +02:00
1f5cef17d2
Handle Twitter duplicates (#20)
This commit adds a hash attribute to help identify duplicate messages. Tweets
have a TweetID attribute for the initial thread identifier and a LastTweetID
attribute to keep track of the last reply to eventually continue the thread if a
duplicate is detected.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-15 15:13:00 +02:00
9629483953
Ignore *.bak files
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-15 08:40:39 +02:00
5ba0699adc
Bugfix asynchronous loop
When workers threshold was reached, the current parser was skipped instead of
being processed later. Adding a for loop to retry instead.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-12 09:21:24 +02:00
e57a1c0148
Add tests for utils.go
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-12 08:49:11 +02:00
9f51c62776
Add MySQL support (#24)
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-08 15:20:23 +02:00
d583d559d1
Bugfix Twitter foreign key
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-07 08:46:09 +02:00
0e524b35b8
Include chromium in docker-compose
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-07 08:38:53 +02:00
9b6d3cf745
Release 0.5.1
- Add PostgreSQL support (#23)
- Keep track and remove stale products
- Select or create shop before parsing
- Remove auto increment from primary key
- Enable replies on Twitter and Telegram

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-04-06 10:35:04 +02:00
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