Toon app: Afvalwijzer

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Toon app: Afvalwijzer

Post by Xavier »

Toonz wrote:
Xavier wrote:I still haven't got any data for RD4.
Is it possible to have a look at that? :)[/quote

It's a certificate issue, will look for the CA authorities certificate later today.
P.S. works fine on a Toon2 out of the box ;-)

to be continued
ahh ok, so it isn't an user error :D
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

Xavier wrote:ahh ok, so it isn't an user error :D
no, it isn't because of SNI , TheHogNL just had a look (see also here: viewtopic.php?f=99&t=11669&start=570#p88971 )
SNI is supported on Toon 2 but not on Toon 1 unfortunately.

Luckily there is a fallback: use cron and a script with wget with the parameter --no-check-certificate as described in the manuals section.
In the mean time I will change the app for this.... stay tuned
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

Hi all,

I just published 4.15 in ToonStore, fixing avalex.nl for 2019
The RD4info.nl html content is completely renewed, so need to implement that one from scratch.
Will take a bit longer.....

Kind regardz,

Toonz
member of the Toon Software Collective
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Toon app: Afvalwijzer

Post by Xavier »

Toonz wrote:Hi all,

I just published 4.15 in ToonStore, fixing avalex.nl for 2019
The RD4info.nl html content is completely renewed, so need to implement that one from scratch.
Will take a bit longer.....

Kind regardz,

Toonz
Hi Toonz,

did you find some time for rebuilding RD4Info? :)
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

not started yet, it's ready when it's ready :-)
member of the Toon Software Collective
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Toon app: Afvalwijzer

Post by hvxl »

The format of the calendar file from gad.nl seems to have changed. Apparently they changed from DATE-TIME entries to DATE entries. So lines that used to only say "DTSTART" have changed to "DTSTART;VALUE=DATE". Adding '|| (wasteCollector == "26")' to if statements in two places fixes the issue.
Schelte
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

hvxl wrote:The format of the calendar file from gad.nl seems to have changed. Apparently they changed from DATE-TIME entries to DATE entries. So lines that used to only say "DTSTART" have changed to "DTSTART;VALUE=DATE". Adding '|| (wasteCollector == "26")' to if statements in two places fixes the issue.
Will fix it in the next few days... This is the fourth ical format change like this. Have now changed the app to read any of the DATE formats.
member of the Toon Software Collective
hdok
Starting Member
Starting Member
Posts: 22
Joined: Thu Jul 26, 2018 12:39 pm

Re: Toon app: Afvalwijzer

Post by hdok »

As you might remember I had issues with Afvalwijzer and retrieving information for venlo.nl just installed 5.0.4 on my toon1: AFval wijzer works as it did before! YES, me happy
michel30
Member
Member
Posts: 286
Joined: Fri Aug 25, 2017 4:42 pm

Re: Toon app: Afvalwijzer

Post by michel30 »

Xavier wrote:I still haven't got any data for RD4.
Is it possible to have a look at that? :)
My RD4 works but it is 4.14 plus maybe it is the cash till april I can see...
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

michel30 wrote:
Xavier wrote:I still haven't got any data for RD4.
Is it possible to have a look at that? :)
My RD4 works but it is 4.14 plus maybe it is the cash till april I can see...
It's probably your cached data, yes.
Problem with RD4 is the website's certificate as described elsewhere. This new type of certificates is supported on Toon 2 but not on Toon 1.
Couple of options exist to as a workaround. Will start looking into this next week earliest…
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

Hi all,

Version 4.16 is available in ToonStore.
gad.nl is now fixed by a small modification to make the application resilient against DATE format changes.
As the same piece of code is shared by many waste collectors (see below), there could be a potential impact with others.
Just let me know if you encounter issues.

Changelog 4.16
4.16
- made a change for a group of waste collectors which retrieves ICS files automatically.
It doesn't matter anymore in which format the provider sends the DATE field.
As this is a generic change for all waste collector below, I might potentially have created an issue elsewhere.
Compared to the previous release gad.nl should work again now.

Impacted waste collectors:
3: "cure-afvalbeheer.nl"
4: "cyclusnv.nl"
6: "hvcgroep.nl"
7: "dar.nl"
16: "meerlanden.nl"
18: "zrd.nl"
23: "alphenaandenrijn.nl"
24: "avalex.nl"
26: "gad.nl"
27: "venlo.nl"

Kind regards,

Toonz
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: Afvalwijzer

Post by Toonz »

Hi all,

I propose the following solution for the provider rd4info.nl on a Toon 1 which is broken due to unsupported SSL functionality on a Toon 1.
On a Toon 2 the current functionality is working fine (rd4info.nl as wastecollector 17).

I created a second wastecollector id for rd4info (28) for use on a Toon 1 only.
As the data cannot be retrieved via QML you will need to download the rd4info calendar via wget with the option --no-check-certificates.
This can be done via a cron job and a simple script (explained in detail in the manuals section on the forum).

Steps to take:
1. login via SSH and create a folder 'waste' under root
2. install cron and wget if not already present using the manuals
3. the script to be scheduled running every week or so should contain (of course change the zipcode/housenr to yours):

Code: Select all

wget --no-check-certificate "https://www.rd4info.nl/NSI/Burger/Aspx/afvalkalender_public_text.aspx?pc=6441kw&nr=141&t=" -O /root/waste/rd4info.txt
4. run the script at least once
5. install the new 4.17 app from ToonStore and switch to wastecollector 28

I will release version 4.17 shortly.

Kind regardz,

Toonz
member of the Toon Software Collective
bananenman
Starting Member
Starting Member
Posts: 3
Joined: Sun Jan 27, 2019 5:50 pm

Re: Toon app: Afvalwijzer

Post by bananenman »

Since it is always a good idea to implement your own way of sharing data (sarcasm mode) the people of https://www.acv-groep.nl/ decided to stop with submitting their data to afvalwijzer.nl and implement their own application.

They are now using http://www.acv-afvalkalender.nl/ which produces a lot of Json garbage.

First you need to submit a request as follows:

Code: Select all

curl 'https://wasteapi.2go-mobile.com/api/FetchAdress' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: nl,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: https://wasteapi.2go-mobile.com' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://afvalportaal.2go-mobile.com' -H 'Connection: keep-alive' -H 'TE: Trailers' --data '{"postCode":"6711DD","houseNumber":"4","companyCode":"f8e2844a-095e-48f9-9f98-71fceb51d2c3"}'
This results in receiving address information and unique id:

Code: Select all

{"userMessage":{"type":null,"messageCode":0,"description":null},"ExtraOption":{"$type":"System.Dynamic.ExpandoObject, System.Core"},"dataList":[{"UniqueId":"698629","Street":"Bergstraat","HouseNumber":"4","HouseLetter":"","HouseNumberIndication":null,"HouseNumberAddition":"","ZipCode":"6711DD","City":"EDE GLD","Community":"EDE","AddressType":"","Floor":null,"AddressUniqueId":0,"AddressUnique":null}],"intDataList":null,"data":null,"status":true,"messageCode":107,"token":null,"pdfResponse":null,"ID":null,"invalidParameters":null,"total":0,"messageToString":null}
This information can be used to send another request to receive the pickup date list as follows:

Code: Select all

curl 'https://wasteapi.2go-mobile.com/api/GetCalendar' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: nl,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: https://wasteapi.2go-mobile.com' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://afvalportaal.2go-mobile.com' -H 'Connection: keep-alive' -H 'TE: Trailers' --data '{"companyCode":"f8e2844a-095e-48f9-9f98-71fceb51d2c3","startDate":"2018-12-21","endDate":"2022-01-09","uniqueAddressID":"698629"}'
Resulting in this piece of json excrement:

Code: Select all

{"userMessage":{"type":null,"messageCode":0,"description":null},"ExtraOption":{"$type":"System.Dynamic.ExpandoObject, System.Core"},"dataList":[{"pickupDates":["2019-01-10T00:00:00","2019-01-17T00:00:00","2019-01-24T00:00:00","2019-01-31T00:00:00","2019-02-07T00:00:00","2019-02-14T00:00:00","2019-02-21T00:00:00","2019-02-28T00:00:00","2019-03-07T00:00:00","2019-03-14T00:00:00","2019-03-21T00:00:00","2019-03-28T00:00:00","2019-04-04T00:00:00","2019-04-11T00:00:00","2019-04-18T00:00:00","2019-04-25T00:00:00","2019-05-02T00:00:00","2019-05-09T00:00:00","2019-05-16T00:00:00","2019-05-23T00:00:00","2019-06-01T00:00:00","2019-06-06T00:00:00","2019-06-13T00:00:00","2019-06-20T00:00:00","2019-06-27T00:00:00","2019-07-04T00:00:00","2019-07-11T00:00:00","2019-07-18T00:00:00","2019-07-25T00:00:00","2019-08-01T00:00:00","2019-08-08T00:00:00","2019-08-15T00:00:00","2019-08-22T00:00:00","2019-08-29T00:00:00","2019-09-05T00:00:00","2019-09-12T00:00:00","2019-09-19T00:00:00","2019-09-26T00:00:00","2019-10-03T00:00:00","2019-10-10T00:00:00","2019-10-17T00:00:00","2019-10-24T00:00:00","2019-10-31T00:00:00","2019-11-07T00:00:00","2019-11-14T00:00:00","2019-11-21T00:00:00","2019-11-28T00:00:00","2019-12-05T00:00:00","2019-12-12T00:00:00","2019-12-19T00:00:00","2019-12-28T00:00:00"],"pickupType":10,"_pickupType":10,"_pickupTypeText":"PACKAGES","description":"-"}],"intDataList":null,"data":null,"status":true,"messageCode":107,"token":null,"pdfResponse":null,"ID":null,"invalidParameters":null,"total":0,"messageToString":null}
Does anyone see any way to implement this into the application? Cause I don't. I am not familiar with json parsers and if they are available on the Toon.
It could be implemented with a gateway server which translates to the correct format but I do not really want to implement this, this introduces a step in the process prone to error.
guustflater89
Starting Member
Starting Member
Posts: 2
Joined: Tue Dec 08, 2015 12:40 am

Re: Toon app: Afvalwijzer

Post by guustflater89 »

Toonz wrote:
Impacted waste collectors:
3: "cure-afvalbeheer.nl"
4: "cyclusnv.nl"
6: "hvcgroep.nl"
7: "dar.nl"
16: "meerlanden.nl"
18: "zrd.nl"
23: "alphenaandenrijn.nl"
24: "avalex.nl"
26: "gad.nl"
27: "venlo.nl"

Kind regards,

Toonz
Rmn.nl is also affected by the date issue...
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon app: Afvalwijzer

Post by TheHogNL »

bananenman wrote:Since it is always a good idea to implement your own way of sharing data (sarcasm mode) the people of https://www.acv-groep.nl/ decided to stop with submitting their data to afvalwijzer.nl and implement their own application.

They are now using http://www.acv-afvalkalender.nl/ which produces a lot of Json garbage.

Does anyone see any way to implement this into the application? Cause I don't. I am not familiar with json parsers and if they are available on the Toon.
It could be implemented with a gateway server which translates to the correct format but I do not really want to implement this, this introduces a step in the process prone to error.
I think Toonz would agree if there would be a standard to be used for are gemeentes' to produce useful waste calendar data :-)

About JSON. JSON stands for JavaScript Object Notation. And the Toon internal QML interface is using javascript like language, fully understandig JSON. So objects are easily stored in JSON structures. No need to 'parse' anything.

So that makes it easier. However sticking with afvalwijzer.nl would have been easier :-)
Member of the Toon Software Collective
Post Reply

Return to “Toon Apps”