Skip to content

Commit

Permalink
Merge pull request #758 from dt215git/manc
Browse files Browse the repository at this point in the history
Updated Manchester City Council
  • Loading branch information
mampfes authored Mar 14, 2023
2 parents fc01539 + 88cf081 commit acb38ed
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
URL = "https://www.manchester.gov.uk"
TEST_CASES = {
"domestic": {"uprn": "000077065560"},
"large_domestic": {"uprn": 77116538},
}

API_URL = "https://www.manchester.gov.uk/bincollections/"
Expand All @@ -18,14 +19,17 @@
"Blue Bin": "mdi:recycle",
"Brown Bin": "mdi:glass-fragile",
"Green Bin": "mdi:leaf",
"Large Blue Container": "mdi:recycle",
"Large Brown Container": "mdi:glass-fragile",
"Large Domestic Waste Container": "mdi:trash-can",
}

_LOGGER = logging.getLogger(__name__)


class Source:
def __init__(self, uprn: int):
self._uprn = uprn
self._uprn = str(uprn).zfill(12)

def fetch(self):
entries = []
Expand All @@ -44,8 +48,8 @@ def fetch(self):
dates.append(str(date.text).replace("Next collection ", "", 1))
for date in result.find_all("li"):
dates.append(date.text)
img_tag = result.find("img")
collection_type = img_tag["alt"]
h3_tag = result.find("h3")
collection_type = h3_tag.text.replace("DUE TODAY", "").strip()
for current_date in dates:
date = datetime.strptime(current_date, "%A %d %b %Y").date()
entries.append(
Expand Down

0 comments on commit acb38ed

Please sign in to comment.