Page 41 of 84

Re: Toon app: Afvalwijzer

Posted: Tue Jan 22, 2019 9:17 pm
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

Re: Toon app: Afvalwijzer

Posted: Tue Jan 22, 2019 11:14 pm
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

Re: Toon app: Afvalwijzer

Posted: Tue Jan 22, 2019 11:45 pm
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

Re: Toon app: Afvalwijzer

Posted: Fri Jan 25, 2019 1:27 pm
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? :)

Re: Toon app: Afvalwijzer

Posted: Fri Jan 25, 2019 4:03 pm
by Toonz
not started yet, it's ready when it's ready :-)

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 1:00 am
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.

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 11:19 am
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.

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 1:37 pm
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

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 3:56 pm
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...

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 4:24 pm
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…

Re: Toon app: Afvalwijzer

Posted: Sat Jan 26, 2019 4:29 pm
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

Re: Toon app: Afvalwijzer

Posted: Sun Jan 27, 2019 3:14 pm
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

Re: Toon app: Afvalwijzer

Posted: Sun Jan 27, 2019 6:10 pm
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.

Re: Toon app: Afvalwijzer

Posted: Sun Jan 27, 2019 6:22 pm
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...

Re: Toon app: Afvalwijzer

Posted: Sun Jan 27, 2019 6:25 pm
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 :-)