add user agent to counts

This commit is contained in:
Will Freeman
2026-02-01 16:51:53 -07:00
parent cb343d8369
commit ea218998b3
2 changed files with 3 additions and 2 deletions

View File

@@ -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.

View File

@@ -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()