refactor sector27 source

simplify configuration: use city and street instead of magic id's
This commit is contained in:
mampfes
2021-08-24 20:34:54 +02:00
parent d53fa4fcba
commit 8989d07d0c
2 changed files with 78 additions and 104 deletions

View File

@@ -1,8 +1,6 @@
http://muellkalender.sector27.de/muellkalender-oer-erkenschwick.html
# sector27.de
Support for schedules provided by [Sector27.de](https://muellkalender.sector27.de). Some Cities use this service, e.g. Datteln,Oer-Erkenschwick and Marl. This source will show you schedules from the actualmonth an 2 month ahead.
Support for schedules provided by [Sector27.de](https://muellkalender.sector27.de). Some cities use this service, e.g. Datteln, Oer-Erkenschwick and Marl.
## Configuration via configuration.yaml
@@ -11,28 +9,18 @@ waste_collection_schedule:
sources:
- name: sector27_de
args:
licenseKey: VALIDKEY
cityId: CITYID
streetId: STREETID
fetchRange: FETCHRANGE
city: CITY
street: STREET
```
### Configuration Variables
**VALIDKEY**<br>
**CITY**<br>
*(string) (required)*
**CITIYID**<br>
**STREET**<br>
*(string) (required)*
**STREETID**<br>
*(string) (required)*
**FETCHRANGE**<br>
*(string) (optional)* default: month or year
The `fetchRange` limits the query count to the server. "Month" does three queries, "year" usually one, only in nov/dec it does two.
## Example
```yaml
@@ -40,22 +28,6 @@ waste_collection_schedule:
sources:
- name: sector27_de
args:
licenseKey: Dattelnx2345612
cityId: 9
streetId: 2162
fetchRange: year
city: Marl
street: Ahornweg
```
## How to get the source arguments
At this time this can only be done via "hacking". You have to open the website of your service.
e.g. [Oer-Erkenschwick](http://muellkalender.sector27.de/muellkalender-oer-erkenschwick.html)
select your street and press "aktualisieren". The schedule for your street is shown.
Now start the developer tools in your browser (usually with F12). Press "aktualisieren" again and look in "network" tab wich url is refreshed. There is on that looks like this:
https://muellkalender.sector27.de/web/fetchPickups?callback=callbackFunc&*licenseKey=OSCXXXKREHXXX*&serverStage=development&*cityId=8*&*streetId=1789*&viewdate=1627812000&viewrange=yearRange&_=1629621078660
Take the marked values and you are prepared.