mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 05:06:33 +01:00
doncaster_gov_uk fetches 1 year isntead of 3 weeks
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import requests
|
||||
from waste_collection_schedule import Collection # type: ignore[attr-defined]
|
||||
|
||||
TITLE = "City of Doncaster Council"
|
||||
DESCRIPTION = "Source for doncaster.gov.uk services for the City of Doncaster Council, UK."
|
||||
DESCRIPTION = (
|
||||
"Source for doncaster.gov.uk services for the City of Doncaster Council, UK."
|
||||
)
|
||||
URL = "https://doncaster.gov.uk"
|
||||
|
||||
TEST_CASES = {
|
||||
@@ -29,13 +32,11 @@ class Source:
|
||||
def __init__(self, uprn):
|
||||
self._uprn = str(uprn).zfill(12)
|
||||
|
||||
|
||||
def fetch(self):
|
||||
|
||||
# Query needs start and end epoch dates
|
||||
# Query needs start and end epoch dates
|
||||
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
start = (today - timedelta(weeks=3)).strftime("%s")
|
||||
end = (today + timedelta(weeks=3)).strftime("%s")
|
||||
start = (today - timedelta(days=365)).strftime("%s")
|
||||
end = (today + timedelta(days=365)).strftime("%s")
|
||||
url = f"https://www.doncaster.gov.uk/Compass/PremiseDetail/GetCollectionsForCalendar?UPRN={self._uprn}&Start={start}&End={end}"
|
||||
# start = start.strftime("%s")
|
||||
# end = end.strftime("%s")
|
||||
|
||||
Reference in New Issue
Block a user