diff --git a/_data/smoothing-pools-processed.json b/_data/smoothing-pools-processed.json index d235cf0..46194af 100644 --- a/_data/smoothing-pools-processed.json +++ b/_data/smoothing-pools-processed.json @@ -1 +1 @@ -{"smooth":{"validators_active":1914,"validators_pending":13,"validators_total":1927},"smoothly":{"validators_active":55,"validators_pending":66,"validators_total":121}} \ No newline at end of file +{"smooth":{"validators_active":1934,"validators_pending":12,"validators_total":1946},"smoothly":{"validators_active":56,"validators_pending":65,"validators_total":121}} \ No newline at end of file diff --git a/_scripts/__pycache__/for_hire_listings.cpython-312.pyc b/_scripts/__pycache__/for_hire_listings.cpython-312.pyc new file mode 100644 index 0000000..c244b45 Binary files /dev/null and b/_scripts/__pycache__/for_hire_listings.cpython-312.pyc differ diff --git a/_scripts/__pycache__/hardware.cpython-312.pyc b/_scripts/__pycache__/hardware.cpython-312.pyc index 88878fd..3cb51c1 100644 Binary files a/_scripts/__pycache__/hardware.cpython-312.pyc and b/_scripts/__pycache__/hardware.cpython-312.pyc differ diff --git a/_scripts/__pycache__/job_listings.cpython-312.pyc b/_scripts/__pycache__/job_listings.cpython-312.pyc new file mode 100644 index 0000000..bedb3e2 Binary files /dev/null and b/_scripts/__pycache__/job_listings.cpython-312.pyc differ diff --git a/_scripts/__pycache__/smoothing_pools.cpython-312.pyc b/_scripts/__pycache__/smoothing_pools.cpython-312.pyc index d8afb21..ee4e841 100644 Binary files a/_scripts/__pycache__/smoothing_pools.cpython-312.pyc and b/_scripts/__pycache__/smoothing_pools.cpython-312.pyc differ diff --git a/_scripts/__pycache__/utilities.cpython-312.pyc b/_scripts/__pycache__/utilities.cpython-312.pyc index 6d0f720..557fa6d 100644 Binary files a/_scripts/__pycache__/utilities.cpython-312.pyc and b/_scripts/__pycache__/utilities.cpython-312.pyc differ diff --git a/_scripts/collect_data.py b/_scripts/collect_data.py index edc5fa9..c5856fe 100644 --- a/_scripts/collect_data.py +++ b/_scripts/collect_data.py @@ -7,10 +7,10 @@ def run_app(): - update_smoothing_pool_data() - check_hardware_availability() + # update_smoothing_pool_data() + # check_hardware_availability() update_job_listings() - update_for_hire_listings() + # update_for_hire_listings() diff --git a/_scripts/for_hire_listings.py b/_scripts/for_hire_listings.py index 23ebaa6..67e05ac 100644 --- a/_scripts/for_hire_listings.py +++ b/_scripts/for_hire_listings.py @@ -74,7 +74,7 @@ def update_for_hire_listings(): save_listing_data(processed_data) except: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__update_for_hire_listings") diff --git a/_scripts/hardware.py b/_scripts/hardware.py index e7a8584..0c08842 100644 --- a/_scripts/hardware.py +++ b/_scripts/hardware.py @@ -55,7 +55,7 @@ def check_hardware_availability(): save_unavailable_products_data(updated_unavailable_products) else: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__check_hardware_availability") return diff --git a/_scripts/job_listings.py b/_scripts/job_listings.py index 1dc25cd..edd38f4 100644 --- a/_scripts/job_listings.py +++ b/_scripts/job_listings.py @@ -28,10 +28,13 @@ def get_listing_data(): } # get the sheet data # reference: https://docs.gspread.org/en/v5.7.0/user-guide.html + print("gc...") gc = gspread.service_account_from_dict(credentials) - sheet = gc.open_by_key("1FN73olU-8djRhfGqEc7-2LsjfwR6Qqj0T3Y5-bfxHqs").worksheet("Job Listings") + print("sheet...") + sheet = gc.open_by_key(utilities.SHEETS_URL).worksheet("Job Listings") + print("sheet_data...") sheet_data = sheet.get_all_records() - # utilities.log(sheet_data, context=f"{script_id}__get_listing_data") + utilities.log(sheet_data, context=f"{script_id}__get_listing_data") return sheet_data def process_listing_data(raw_data): @@ -69,11 +72,18 @@ def save_listing_data(processed_data): def update_job_listings(): try: raw_data = get_listing_data() + except Exception as e: + print(e) + try: processed_data = process_listing_data(raw_data) + except Exception as e: + print(e) + try: save_listing_data(processed_data) - except: - error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") - utilities.report_error(error, context=f"{script_id}__update_job_listings") - + except Exception as e: + print(e) + # except: + # error = f"Bad response" + # utilities.log(f"{error}: {script_id}") + # utilities.report_error(error, context=f"{script_id}__update_job_listings") diff --git a/_scripts/requirements.txt b/_scripts/requirements.txt index d0cc4df..3b148b7 100644 --- a/_scripts/requirements.txt +++ b/_scripts/requirements.txt @@ -1,5 +1,4 @@ -# gspread==6.1.2 -gspread==5.7.0 +gspread==5.12.4 python-dotenv==1.0.1 PyYAML==6.0.1 PyYAML==6.0.1 diff --git a/_scripts/smoothing_pools.py b/_scripts/smoothing_pools.py index c2738d8..17a6316 100644 --- a/_scripts/smoothing_pools.py +++ b/_scripts/smoothing_pools.py @@ -68,7 +68,7 @@ def update_smoothing_pool_data(): save_smoothing_pool_data(smooth_subs, smoothly_subs) else: error = f"Bad response" - utilities.log(f"{error}: {metric_id}_{data_source}") + utilities.log(f"{error}: {script_id}") utilities.report_error(error, context=f"{script_id}__update_smoothing_pool_data") return diff --git a/_scripts/utilities.py b/_scripts/utilities.py index 5b56938..d393284 100644 --- a/_scripts/utilities.py +++ b/_scripts/utilities.py @@ -30,7 +30,7 @@ load_dotenv() GOOGLE_TOKEN = os.environ.get("GOOGLE_TOKEN") - +SHEETS_URL = os.environ.get("SHEETS_URL") def fetch(url, method="GET", payload={}, headers={}, retries=2, delay=0, retry_delay=0, context="", data_type="json"):