Skip to content

Commit

Permalink
Update bristol_gov_uk.py (#1390)
Browse files Browse the repository at this point in the history
* Update bristol_gov_uk.py

Actually fix it

* shorten fix replace all time from string + minor reformating

---------

Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
  • Loading branch information
M21B8 and 5ila5 authored Nov 7, 2023
1 parent 4d3276a commit 383b887
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"240L RECYCLING PAPER": "mdi:newspaper",
"1100L GENERAL WASTE": "mdi:trash-can",
"1100L RECYCLING CARD": "mdi:package-varient",
"360L RECYCLING PLASTIC/CANS": "mdi:bottle-soda-classic",
"360L RECYCLING PLASTIC/CANS": "mdi:bottle-soda-classic",
}
HEADERS = {
"Accept": "*/*",
Expand All @@ -51,7 +51,6 @@ def __init__(self, uprn):
self._uprn = str(uprn).zfill(12)

def fetch(self):

s = requests.Session()

# Initialise form
Expand Down Expand Up @@ -83,11 +82,7 @@ def fetch(self):
for item in data:
for collection in item["collection"]:
for collection_date_key in ["nextCollectionDate", "lastCollectionDate"]:
date_string = collection[collection_date_key].replace(
"T00:00:00", ""
).replace(
"T10:00:00", ""
)
date_string = collection[collection_date_key].split("T")[0]
entries.append(
Collection(
date=datetime.strptime(
Expand Down

0 comments on commit 383b887

Please sign in to comment.