In the import library_of_congress Richmond, Virginia is hard-coded in the search terms.
Create two new environment variables for comma separated lists of cities and states to insert into search terms. Something like this:
DEPLOYMENT_CITIES=Riverside,Corona,San Bernardino
DEPLOYMENT_STATES=California
These will default to Richmond, Virginia of course.
Params will then look like
states = "|".join(f"location:{state.lower()}" for state in STATES.split(","))
cities = "|".join(f"location:{city.lower()}" for city in CITIES.split(","))
params = {
"fa": f"{states}|{cities}",
"fo": "json",
"c": items_per_page,
"sp": start_page,
}
This will become the basis of allowing variable cities and states for other deployments.
In the import
library_of_congressRichmond, Virginia is hard-coded in the search terms.Create two new environment variables for comma separated lists of cities and states to insert into search terms. Something like this:
These will default to Richmond, Virginia of course.
Params will then look like
This will become the basis of allowing variable cities and states for other deployments.