mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 05:06:33 +01:00
Add Harlow, UK
This commit is contained in:
@@ -360,6 +360,7 @@ Waste collection schedules in the following formats and countries are supported.
|
||||
- [FCC Environment](/doc/source/fccenvironment_co_uk.md) / fccenvironment.co.uk
|
||||
- [Guildford Borough Council](/doc/source/guildford_gov_uk.md) / guildford.gov.uk
|
||||
- [Harborough District Council](/doc/source/fccenvironment_co_uk.md) / harborough.gov.uk
|
||||
- [Harlow Council](/doc/source/harlow_gov_uk.md) / harlow.gov.uk
|
||||
- [Horsham District Council](/doc/source/horsham_gov_uk.md) / horsham.gov.uk
|
||||
- [Huntingdonshire District Council](/doc/source/huntingdonshire_gov_uk.md) / huntingdonshire.gov.uk
|
||||
- [Lewes District Council](/doc/source/environmentfirst_co_uk.md) / lewes-eastbourne.gov.uk
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import datetime
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
from waste_collection_schedule import Collection
|
||||
|
||||
TITLE = "Harlow Council"
|
||||
DESCRIPTION = "Source for harlow.gov.uk, Harlow Council, UK"
|
||||
URL = "https://www.harlow.gov.uk"
|
||||
TEST_CASES = {
|
||||
"12 Kingfisher Gate, Old Harlow": {"uprn": 10033891501},
|
||||
"4 Ryecroft, Harlow": {"uprn": 100090544008},
|
||||
"2 The Crescent, Harlow": {"uprn": 100090546627},
|
||||
"1 Kerril Croft, Harlow": {"uprn": 10003708086},
|
||||
}
|
||||
|
||||
API_URL = "https://selfserve.harlow.gov.uk/appshost/firmstep/self/apps/custompage/bincollectionsecho?uprn={uprn}"
|
||||
|
||||
ICON_MAP = {
|
||||
"Non-Recycling": "mdi:trash-can",
|
||||
"Food Caddy": "mdi:food-apple",
|
||||
"Recycling": "mdi:recycle",
|
||||
"Green Waste Subscription": "mdi:leaf",
|
||||
"Communal Non-Recycling": "mdi:trash-can",
|
||||
"Communal Recycling": "mdi:recycle",
|
||||
}
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, uprn=None):
|
||||
self._uprn = uprn
|
||||
|
||||
def fetch(self):
|
||||
q = str(API_URL).format(uprn=self._uprn)
|
||||
|
||||
r = requests.get(q)
|
||||
r.raise_for_status()
|
||||
|
||||
responseContent = r.text
|
||||
|
||||
entries = []
|
||||
|
||||
soup = BeautifulSoup(responseContent, "html.parser")
|
||||
x = soup.findAll("div", {"class": "row collectionsrow"})
|
||||
for row in x:
|
||||
fields = row.findChildren()
|
||||
if fields[0].text.strip() == "Please select an address to view the upcoming collections.":
|
||||
continue
|
||||
|
||||
entries.append(
|
||||
Collection(
|
||||
date=datetime.datetime.strptime(
|
||||
fields[3].text, "%a - %d %b %Y\n"
|
||||
).date(),
|
||||
t=fields[2].text,
|
||||
icon=ICON_MAP.get(fields[2].text),
|
||||
)
|
||||
)
|
||||
|
||||
return entries
|
||||
34
doc/source/harlow_gov_uk.md
Normal file
34
doc/source/harlow_gov_uk.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Ashfield District Council
|
||||
|
||||
Support for schedules provided by [Harlow Council](https://www.harlow.gov.uk/), serving Harlow district in Essex, UK.
|
||||
|
||||
## Configuration via configuration.yaml
|
||||
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: harlow_gov_uk
|
||||
args:
|
||||
uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
|
||||
```
|
||||
|
||||
### Configuration Variables
|
||||
|
||||
### Configuration Variables
|
||||
|
||||
**uprn**<br>
|
||||
*(string) (required)*
|
||||
|
||||
|
||||
#### How to find your `UPRN`
|
||||
An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
|
||||
Otherwise you can inspect the web requests the Harlow Council website makes when entering in your postcode and then selecting your address.
|
||||
|
||||
## Example
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: harlow_gov_uk
|
||||
args:
|
||||
uprn: 10023422690
|
||||
```
|
||||
2
info.md
2
info.md
@@ -28,7 +28,7 @@ Waste collection schedules from service provider web sites are updated daily, de
|
||||
| Poland | Ecoharmonogram, Warsaw |
|
||||
| Sweden | Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Ronneby Miljöteknik, SRV Återvinning, SSAM, Sysav Sophämntning, VA Syd Sophämntning |
|
||||
| Switzerland | A-Region, Andwil, Appenzell, Berg, Bühler, Eggersriet, Gais, Gaiserwald, Goldach, Grub, Heiden, Herisau, Horn, Hundwil, Häggenschwil, Lindau, Lutzenberg, Muolen, Mörschwil, Rehetobel, Rorschach, Rorschacherberg, Schwellbrunn, Schönengrund, Speicher, Stein, Steinach, Teufen, Thal, Trogen, Tübach, Untereggen, Urnäsch, Wald, Waldkirch, Waldstatt, Wittenbach, Wolfhalden |
|
||||
| United Kingdom | Ashfield District Council, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Cambridge City Council, Canterbury City Council, Cheshire East Council, Chesterfield Borough Council, City of York Council, Colchester Borough Council, Cornwall Council, Derby City Council, Eastbourne Borough Council, Elmbridge Borough Council, Environment First, FCC Environment, Guildford Borough Council, Harborough District Council, Horsham District Council, Huntingdonshire District Council, Lewes District Council, London Borough of Lewisham, Manchester City Council, Middlesbrough Council, Newcastle City Council, North Somerset Council, Nottingham City Council, Peterborough City Council, Richmondshire District Council, Rushmoor Borough Council, Salford City Council, Sheffield City Council, South Cambridgeshire District Council, South Hams District Council, South Norfolk and Broadland Council, Southampton City Council, Stevenage Borough Council, Telford and Wrekin Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Walsall Council, West Berkshire Council, West Devon Borough Council, Wiltshire Council |
|
||||
| United Kingdom | Ashfield District Council, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Cambridge City Council, Canterbury City Council, Cheshire East Council, Chesterfield Borough Council, City of York Council, Colchester Borough Council, Cornwall Council, Derby City Council, Eastbourne Borough Council, Elmbridge Borough Council, Environment First, FCC Environment, Guildford Borough Council, Harborough District Council, Harlow Council, Horsham District Council, Huntingdonshire District Council, Lewes District Council, London Borough of Lewisham, Manchester City Council, Middlesbrough Council, Newcastle City Council, North Somerset Council, Nottingham City Council, Peterborough City Council, Richmondshire District Council, Rushmoor Borough Council, Salford City Council, Sheffield City Council, South Cambridgeshire District Council, South Hams District Council, South Norfolk and Broadland Council, Southampton City Council, Stevenage Borough Council, Telford and Wrekin Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Walsall Council, West Berkshire Council, West Devon Borough Council, Wiltshire Council |
|
||||
| United States of America | City of Pittsburgh, Republic Services, Seattle Public Utilities |
|
||||
<!--End of country section-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user