Skip to content

Commit

Permalink
Merge pull request #17 from ManagedKube/not-in-title
Browse files Browse the repository at this point in the history
not-in-title
  • Loading branch information
sekka1 authored May 1, 2024
2 parents ac09ae0 + 3cf4011 commit f28e575
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internet-item-price/alert_on_low_price/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ export DISABLE_SLACK=true
export SLACK_CHANNEL=''
```

Run:
Install required packages:
```
pip3 install slack-sdk
pip3 install google-search-results
pip3 install pyyaml
```

Run:
```
python3 alert_on_low_price.py
```
13 changes: 13 additions & 0 deletions internet-item-price/alert_on_low_price/alert_on_low_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ def send_to_slack(message):
if should_skip_item:
continue


## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
should_skip_item = False
for a_title_filter in item['not_in_title']:
if a_title_filter.lower() in product['title'].lower():
# print(f"Skipping (not_in_title): {product['title']}\n")
should_skip_item = True

## If we did not find all of the not_in_title strings in the title, then skip this product
if should_skip_item:
continue

## If the price in item['price']['high'] is greater than the product['extracted_price'], then skip this product
if float(product['extracted_price']) > float(item['price']['high']):
# print(f"Skipping (price): {product['price']}\n")
Expand Down
21 changes: 21 additions & 0 deletions internet-item-price/alert_on_low_price/search_items_gar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ search_items:
additional_title_filters:
- 3 pack
- aqara
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title: []
not_from_these_sellers:
- AliExpress.com
- SmartWearTech
Expand All @@ -24,6 +27,9 @@ search_items:
## resutlts.
additional_title_filters:
- aqara
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title: []
not_from_these_sellers:
- AliExpress.com
- ebay
Expand All @@ -43,6 +49,9 @@ search_items:
- pny
- 16gb
- "4060"
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title: []
not_from_these_sellers:
- AliExpress.com
- ebay
Expand All @@ -60,6 +69,9 @@ search_items:
additional_title_filters:
- msi
- "4070"
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title: []
not_from_these_sellers:
- AliExpress.com
- ebay
Expand All @@ -78,6 +90,9 @@ search_items:
additional_title_filters:
- pny
- "4070"
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title: []
not_from_these_sellers:
- AliExpress.com
- ebay
Expand All @@ -94,6 +109,12 @@ search_items:
## resutlts.
additional_title_filters:
- tower
## The not_in_title list are filters that are used to filter out the results. This one has
## a list of words you do not want to see in the title of the results.
not_in_title:
- mini
- micro
- Zalman
not_from_these_sellers:
- AliExpress.com
price:
Expand Down

0 comments on commit f28e575

Please sign in to comment.