mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 00:04:11 +01:00
jointwastesolutions_org add support for Surrey Heath
This commit is contained in:
@@ -829,6 +829,7 @@ Waste collection schedules in the following formats and countries are supported.
|
||||
- [Stockport Council](/doc/source/stockport_gov_uk.md) / stockport.gov.uk
|
||||
- [Stockton-on-Tees Borough Council](/doc/source/stockton_gov_uk.md) / stockton.gov.uk
|
||||
- [Stratford District Council](/doc/source/stratford_gov_uk.md) / stratford.gov.uk
|
||||
- [Surrey Heath Borough Council](/doc/source/jointwastesolutions_org.md) / surreyheath.gov.uk
|
||||
- [Swindon Borough Council](/doc/source/swindon_gov_uk.md) / swindon.gov.uk
|
||||
- [Telford and Wrekin Council](/doc/source/telford_gov_uk.md) / telford.gov.uk
|
||||
- [Test Valley Borough Council](/doc/source/iweb_itouchvision_com.md) / testvalley.gov.uk
|
||||
|
||||
@@ -18,6 +18,11 @@ EXTRA_INFO = [
|
||||
"url": "https://www.woking.gov.uk",
|
||||
"country": "uk",
|
||||
},
|
||||
{
|
||||
"title": "Surrey Heath Borough Council",
|
||||
"url": "https://www.surreyheath.gov.uk",
|
||||
"country": "uk",
|
||||
},
|
||||
]
|
||||
DESCRIPTION = "Manages Waste and Recycling services for Elmbridge, Mole Valley, Surrey Heath & Woking"
|
||||
TEST_CASES = {
|
||||
@@ -36,8 +41,15 @@ TEST_CASES = {
|
||||
"Test Woking #4": {
|
||||
"house": 5,
|
||||
"postcode": "GU21 4HW",
|
||||
"borough": "woking",
|
||||
},
|
||||
"surrey heath #1": {
|
||||
"house": "1",
|
||||
"postcode": "GU15 1JT",
|
||||
"borough": "surreyheath",
|
||||
},
|
||||
}
|
||||
|
||||
ICON_MAP = {
|
||||
"RUBBISH": "mdi:trash-can",
|
||||
"RECYCLING": "mdi:recycle",
|
||||
@@ -49,22 +61,23 @@ REGEX = r"(\d+\/\d+\/\d+\/[\d\w]+)"
|
||||
|
||||
|
||||
class Source:
|
||||
def __init__(self, house, postcode):
|
||||
def __init__(self, house, postcode, borough="woking"):
|
||||
self._house = str(house).upper().strip()
|
||||
self._postcode = postcode.upper().replace(" ", "+").strip()
|
||||
self._borough = borough.lower().strip()
|
||||
|
||||
def fetch(self):
|
||||
s = requests.Session()
|
||||
|
||||
# Load landing page and extract tracking ID needed for subsequent requests
|
||||
r0 = s.get(
|
||||
"https://asjwsw-wrpwokingmunicipal-live.whitespacews.com/#!",
|
||||
f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com/#!",
|
||||
)
|
||||
trackingID = re.findall(REGEX, r0.text)[0]
|
||||
|
||||
# Load search form
|
||||
s.get(
|
||||
f"https://asjwsw-wrpwokingmunicipal-live.whitespacews.com/?Track={trackingID}&serviceID=A&seq=1#!",
|
||||
f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com/?Track={trackingID}&serviceID=A&seq=1#!",
|
||||
)
|
||||
|
||||
# These headers seem to be required for subsequent queries
|
||||
@@ -74,9 +87,9 @@ class Source:
|
||||
"Cache-Control": "no-cache",
|
||||
"Connection": "keep-alive",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Origin": "https://asjwsw-wrpwokingmunicipal-live.whitespacews.com",
|
||||
"Origin": f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com",
|
||||
"Pragma": "no-cache",
|
||||
"Referer": "https://asjwsw-wrpwokingmunicipal-live.whitespacews.com/",
|
||||
"Referer": f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com/",
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "same-origin",
|
||||
@@ -97,13 +110,13 @@ class Source:
|
||||
|
||||
# Post address search
|
||||
s.post(
|
||||
f"https://asjwsw-wrpwokingmunicipal-live.whitespacews.com/mop.php?serviceID=A&Track={trackingID}&seq=2",
|
||||
f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com/mop.php?serviceID=A&Track={trackingID}&seq=2",
|
||||
headers=headers,
|
||||
params=payload,
|
||||
)
|
||||
# Now retrieve schedule
|
||||
r3 = s.get(
|
||||
f"https://asjwsw-wrpwokingmunicipal-live.whitespacews.com/mop.php?Track={trackingID}&serviceID=A&seq=3&pIndex=1",
|
||||
f"https://asjwsw-wrp{self._borough}municipal-live.whitespacews.com/mop.php?Track={trackingID}&serviceID=A&seq=3&pIndex=1",
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Joint Waste Solutions
|
||||
|
||||
Manages Waste and Recycling services Woking Borough Council.
|
||||
Manages Waste and Recycling services Woking Borough Council and Surrey Heath Borough Council.
|
||||
|
||||
## Configuration via configuration.yaml
|
||||
|
||||
@@ -25,6 +25,11 @@ Ensure a space character is included between the two parts of the postcode, For
|
||||
|
||||
The name or number of the house. When used in combination with the postcode it should uniquely identify the property. If using the house name, it should match the spelling and format used on the website. House numbers seem to be more reliable than house names.
|
||||
|
||||
**borough**
|
||||
*(string) (optional) (default: `woking`)*
|
||||
|
||||
`woking` or `surreyheath`
|
||||
|
||||
## Example
|
||||
|
||||
```yaml
|
||||
@@ -35,3 +40,13 @@ waste_collection_schedule:
|
||||
house: "4"
|
||||
postcode: "GU21 4PQ"
|
||||
```
|
||||
|
||||
```yaml
|
||||
waste_collection_schedule:
|
||||
sources:
|
||||
- name: jointwastesolutions_org
|
||||
args:
|
||||
house: "1"
|
||||
postcode: "GU15 1JT"
|
||||
borough: "surreyheath",
|
||||
```
|
||||
|
||||
2
info.md
2
info.md
@@ -31,7 +31,7 @@ Waste collection schedules from service provider web sites are updated daily, de
|
||||
| Slovenia | Moji odpadki, Ljubljana |
|
||||
| Sweden | Affärsverken, Jönköping - June Avfall & Miljö, Landskrona - Svalövs Renhållning, Lerum Vatten och Avlopp, Linköping - Tekniska Verken, Region Gotland, Ronneby Miljöteknik, Samverkan Återvinning Miljö (SÅM), SRV Återvinning, SSAM, Sysav Sophämntning, Uppsala Vatten och Avfall AB, VA Syd Sophämntning |
|
||||
| Switzerland | A-Region, Andwil, Appenzell, Berg, Bühler, Eggersriet, Gais, Gaiserwald, Goldach, Grosswangen, Grub, Heiden, Herisau, Horn, Hundwil, Häggenschwil, Lindau, Lutzenberg, Muolen, Mörschwil, Münchenstein, Real Luzern, Rehetobel, Rorschach, Rorschacherberg, Schwellbrunn, Schönengrund, Speicher, Stein, Steinach, Teufen, Thal, Trogen, Tübach, Untereggen, Urnäsch, Wald, Waldkirch, Waldstatt, Wittenbach, Wolfhalden |
|
||||
| United Kingdom | Aberdeenshire Council, Amber Valley Borough Council, Ashfield District Council, Ashford Borough Council, Basildon Council, Basingstoke and Deane Borough Council, Bath & North East Somerset Council, Bedford Borough Council, Binzone, Blackburn with Darwen Borough Council, Borough Council of King's Lynn & West Norfolk, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Bristol City Council, Broadland District Council, Broxtowe Borough Council, Buckinghamshire Waste Collection - Former Chiltern, South Bucks or Wycombe areas, Burnley Council, Cambridge City Council, Canterbury City Council, Central Bedfordshire Council, Cherwell District Council, Cheshire East Council, Chesterfield Borough Council, Chichester District Council, City of Doncaster Council, City of York Council, Colchester City Council, Cornwall Council, Croydon Council, Derby City Council, East Cambridgeshire District Council, East Herts Council, East Northamptonshire and Wellingborough, East Riding of Yorkshire Council, Eastbourne Borough Council, Elmbridge Borough Council, Environment First, Exeter City Council, Fareham Council, FCC Environment, Fenland District Council, Fife Council, Gateshead Council, Glasgow City Council, Guildford Borough Council, Harborough District Council, Harlow Council, Herefordshire City Council, Highland, Horsham District Council, Huntingdonshire District Council, iTouchVision, Joint Waste Solutions, Kirklees Council, Leicester City Council, Lewes District Council, Lisburn and Castlereagh City Council, Liverpool City Council, London Borough of Bexley, London Borough of Bromley, London Borough of Lewisham, London Borough of Merton, Maidstone Borough Council, Maldon District Council, Manchester City Council, Mendip District Council, Mid-Sussex District Council, Middlesbrough Council, Newcastle City Council, Newcastle Under Lyme Borough Council, Newport City Council, North Herts Council, North Kesteven District Council, North Lincolnshire Council, North Somerset Council, Nottingham City Council, Oxford City Council, Peterborough City Council, Portsmouth City Council, Reading Council, Redbridge Council, Reigate & Banstead Borough Council, Richmondshire District Council, Rotherham Metropolitan Borough Council, Runnymede Borough Council, Rushcliffe Brough Council, Rushmoor Borough Council, Salford City Council, Sedgemoor District Council, Sheffield City Council, Somerset Council, Somerset County Council, Somerset West & Taunton District Council, South Cambridgeshire District Council, South Derbyshire District Council, South Gloucestershire Council, South Hams District Council, South Holland District Council, South Norfolk Council, South Oxfordshire District Council, South Somerset District Council, South Tyneside Council, Southampton City Council, Stevenage Borough Council, Stockport Council, Stockton-on-Tees Borough Council, Stratford District Council, Swindon Borough Council, Telford and Wrekin Council, Test Valley Borough Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Tonbridge and Malling Borough Council, Uttlesford District Council, Vale of White Horse District Council, Walsall Council, Warrington Borough Council, Waverley Borough Council, Wealden District Council, Welwyn Hatfield Borough Council, West Berkshire Council, West Devon Borough Council, West Dunbartonshire Council, Wigan Council, Wiltshire Council, Windsor and Maidenhead, Wirral Council, Woking Borough Council, Wyre Forest District Council |
|
||||
| United Kingdom | Aberdeenshire Council, Amber Valley Borough Council, Ashfield District Council, Ashford Borough Council, Basildon Council, Basingstoke and Deane Borough Council, Bath & North East Somerset Council, Bedford Borough Council, Binzone, Blackburn with Darwen Borough Council, Borough Council of King's Lynn & West Norfolk, Bracknell Forest Council, Bradford Metropolitan District Council, Braintree District Council, Breckland Council, Bristol City Council, Broadland District Council, Broxtowe Borough Council, Buckinghamshire Waste Collection - Former Chiltern, South Bucks or Wycombe areas, Burnley Council, Cambridge City Council, Canterbury City Council, Central Bedfordshire Council, Cherwell District Council, Cheshire East Council, Chesterfield Borough Council, Chichester District Council, City of Doncaster Council, City of York Council, Colchester City Council, Cornwall Council, Croydon Council, Derby City Council, East Cambridgeshire District Council, East Herts Council, East Northamptonshire and Wellingborough, East Riding of Yorkshire Council, Eastbourne Borough Council, Elmbridge Borough Council, Environment First, Exeter City Council, Fareham Council, FCC Environment, Fenland District Council, Fife Council, Gateshead Council, Glasgow City Council, Guildford Borough Council, Harborough District Council, Harlow Council, Herefordshire City Council, Highland, Horsham District Council, Huntingdonshire District Council, iTouchVision, Joint Waste Solutions, Kirklees Council, Leicester City Council, Lewes District Council, Lisburn and Castlereagh City Council, Liverpool City Council, London Borough of Bexley, London Borough of Bromley, London Borough of Lewisham, London Borough of Merton, Maidstone Borough Council, Maldon District Council, Manchester City Council, Mendip District Council, Mid-Sussex District Council, Middlesbrough Council, Newcastle City Council, Newcastle Under Lyme Borough Council, Newport City Council, North Herts Council, North Kesteven District Council, North Lincolnshire Council, North Somerset Council, Nottingham City Council, Oxford City Council, Peterborough City Council, Portsmouth City Council, Reading Council, Redbridge Council, Reigate & Banstead Borough Council, Richmondshire District Council, Rotherham Metropolitan Borough Council, Runnymede Borough Council, Rushcliffe Brough Council, Rushmoor Borough Council, Salford City Council, Sedgemoor District Council, Sheffield City Council, Somerset Council, Somerset County Council, Somerset West & Taunton District Council, South Cambridgeshire District Council, South Derbyshire District Council, South Gloucestershire Council, South Hams District Council, South Holland District Council, South Norfolk Council, South Oxfordshire District Council, South Somerset District Council, South Tyneside Council, Southampton City Council, Stevenage Borough Council, Stockport Council, Stockton-on-Tees Borough Council, Stratford District Council, Surrey Heath Borough Council, Swindon Borough Council, Telford and Wrekin Council, Test Valley Borough Council, Tewkesbury Borough Council, The Royal Borough of Kingston Council, Tonbridge and Malling Borough Council, Uttlesford District Council, Vale of White Horse District Council, Walsall Council, Warrington Borough Council, Waverley Borough Council, Wealden District Council, Welwyn Hatfield Borough Council, West Berkshire Council, West Devon Borough Council, West Dunbartonshire Council, Wigan Council, Wiltshire Council, Windsor and Maidenhead, Wirral Council, Woking Borough Council, Wyre Forest District Council |
|
||||
| United States of America | Albuquerque, New Mexico, USA, City of Oklahoma City, City of Pittsburgh, Louisville, Kentucky, USA, Newark, Delaware, USA, Olympia, Washington, USA, ReCollect, Recycle Coach, Republic Services, Seattle Public Utilities, Tucson, Arizona, USA |
|
||||
<!--End of country section-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user