From 7b749c661e668ac9695861f34fab75b845a32316 Mon Sep 17 00:00:00 2001 From: garland Date: Thu, 25 Apr 2024 10:05:23 -0700 Subject: [PATCH] updating --- internet-item-price/alert_on_low_price/README.md | 3 +++ internet-item-price/alert_on_low_price/alert_on_low_price.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internet-item-price/alert_on_low_price/README.md b/internet-item-price/alert_on_low_price/README.md index 8be960ed..dc573196 100644 --- a/internet-item-price/alert_on_low_price/README.md +++ b/internet-item-price/alert_on_low_price/README.md @@ -68,9 +68,12 @@ values ``` # Setup +Can get the google serg API key at: https://serpapi.com/playground?engine=google_shopping&q=Aqara+water+leak+sensor+3+pack&location=United+States&gl=us&hl=en + env: ``` export SERP_API_KEY= +export SEARCH_ITEMS_YAML_FILE=search_items_gar.yaml ``` Run: diff --git a/internet-item-price/alert_on_low_price/alert_on_low_price.py b/internet-item-price/alert_on_low_price/alert_on_low_price.py index 4f8bd744..5aebcc37 100644 --- a/internet-item-price/alert_on_low_price/alert_on_low_price.py +++ b/internet-item-price/alert_on_low_price/alert_on_low_price.py @@ -6,9 +6,10 @@ ## https://serpapi.com/playground?engine=google_shopping&q=aqara+water+leak+sensor+3+pack&location=United+States&gl=us&hl=en api_key = os.environ['SERP_API_KEY'] +search_items_gar_yaml = os.environ['SEARCH_ITEMS_YAML_FILE'] ## Open the yaml file and read the contents -with open('search_items_gar.yaml', 'r') as file: +with open(search_items_gar_yaml, 'r') as file: data = yaml.safe_load(file) # Access the list by its key and loop through it