From ea218998b31242abefd838d45be60e363661b048 Mon Sep 17 00:00:00 2001 From: Will Freeman Date: Sun, 1 Feb 2026 16:51:53 -0700 Subject: [PATCH] add user agent to counts --- serverless/alpr_counts/README.md | 2 +- serverless/alpr_counts/src/alpr_counts.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/serverless/alpr_counts/README.md b/serverless/alpr_counts/README.md index 5c54136..c8e3d94 100644 --- a/serverless/alpr_counts/README.md +++ b/serverless/alpr_counts/README.md @@ -3,4 +3,4 @@ Counts total ALPRs reported in the OSM database, hourly. OSM's Overpass API is used to query for counts of all ALPRs and ALPRs in the United States. The counts are stored in a JSON file in an S3 bucket. ## Deploying -This Lambda uses a zip file, so from the `/terraform` directory, you can run `terraform apply` after making changes, and it should detect the changes, rebuild the zip, and update the Lambda's function code. +This Lambda uses a zip file, so from the `/terraform` directory, you can run `terraform apply -target=module.alpr_counts` after making changes, and it should detect the changes, rebuild the zip, and update the Lambda's function code. diff --git a/serverless/alpr_counts/src/alpr_counts.py b/serverless/alpr_counts/src/alpr_counts.py index a5f5389..618e66d 100644 --- a/serverless/alpr_counts/src/alpr_counts.py +++ b/serverless/alpr_counts/src/alpr_counts.py @@ -25,8 +25,9 @@ def fetch_alpr_surveillance_nodes(usOnly=True): def fetch_wins_count(): cms_url = "https://cms.deflock.me/items/RecentWins" + headers = {'User-Agent': 'deflock-alpr-counts/1.0'} - response = requests.get(cms_url) + response = requests.get(cms_url, headers=headers) if response.status_code == 200: response_json = response.json()