Toon app: PostNL

Forum about forum-provided applications on Toon

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Re: Toon app: PostNL

Postby copywizard » Sat Feb 01, 2020 11:14 pm

Toonz wrote:The login process seems to be broken again lately for the Postnl app. Will have a look again, but not soon due to other commitments next week


no problem thanks in advanced !
copywizard
Starting Member
Starting Member
 
Posts: 7
Joined: February 2020

Re: Toon app: PostNL

Postby glsf91 » Sun Feb 02, 2020 10:47 am

Toonz wrote:The login process seems to be broken again lately for the Postnl app. Will have a look again, but not soon due to other commitments next week


For me the actual login is still working.
I still see a recent json file on the Toon with valid data in /tmp, so the real login is still working. But the Tile is still saying " Bezig met inloggen". Only processing after it is not showing a result in my case.

The cause was I had a first entry on the receiver json which was blocking showing the result in someway. After removing this one in the POSTNL App (not website) it was showing all results again.
This was an entry according to the website " Nog niet te volgen".
The contents of the json was:


Code: Select all
   "receiver": [{
         "shipmentType": "Pending",
         "effectiveDate": "0001-01-01T00:00:00+00:00",
         "key": "3SQDBN891119901-NL-xxxxAW",
         "barcode": "3SQDBN891119901",
         "country": "NL",
         "postalCode": "xxxxAW",
         "isInternational": false,
         "product": null,
         "description": null,
         "pickup": null,
         "delivery": {
            "barcode": "3SQDBN891119901",
            "status": "InTransit",
            "phase": {
               "index": null,
               "message": "Shipment not yet found",
               "route": null
            },
            "returnEligibility": null,
            "firstDeliveryAttemptExpired": false,
            "firstDeliveryAttemptDate": null,
            "isDelivered": false,
            "hasProofOfDelivery": false,
            "deliveryDate": null,
            "timeframe": null,
            "deliveryStatusType": "Standard"
         },
         "rerouting": {
            "barcode": "3SQDBN891119901",
            "unavailabilityReason": null,
            "availableOptions": {},
            "rerouteInstruction": null,
            "isAvailable": false,
            "sponsorName": null
         },
         "beforeFirstDeliveryAttempt": true,
         "firstDeliveryAttemptFailed": false,
         "amounts": {},
         "extraInformation": [],
         "sender": null,
         "receiver": null,
         "originalReceiver": null,
         "return": null,
         "deliveryLocation": null,
         "dimensions": null,
         "multiColloPackages": [],
         "notifications": [],
         "generatedTitles": {
            "receiver": "3SQDBN891119901",
            "sender": "3SQDBN891119901"
         },
         "order": 0,
         "trackedShipment": {
            "id": 154091940,
            "barcode": "3SQDBN891119901",
            "postalCode": "xxxxAW",
            "country": "NL",
            "title": null,
            "listNameKey": "receiver",
            "box": "Receiver",
            "status": "Delivered",
            "source": "ManuallyAddedThroughWeb",
            "order": null,
            "key": "3SQDBN891119901-NL-xxxxAW"
         },
         "tripInformation": null,
         "allObservations": null,
         "isReturnShipment": null,
         "pickUpRetailBarcode": null
      },


Also the screen with the overview was not filled.
I think you can create such an entry by searching in the postnl app (not website) for a non existing barcode and choose " Zending bewaren". Then this entry will be at the start of the receiver list.
So maybe better to filter out this kind of entries.

Maybe also an idea to add a " debug" switch on the settings screen (or always turn it on) and logging the several steps and the outcome (not the json) to a logfile in /tmp. Of course overwriting the logging with every cycle so the filesystem won't fill up.
glsf91
Member
Member
 
Posts: 109
Joined: September 2017

Re: Toon app: PostNL

Postby Toonz » Sun Feb 02, 2020 12:35 pm

Thanks for the tip. Status "Pending" I hadn't seen before indeed. I can image the java code gives an error somewhere on this status and execution is stopped.
I wil also enable debugging all steps by default in tmp.
Will not be soon as I will be travelling coming week.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby speedyconnalis » Thu Feb 20, 2020 9:09 pm

Hi, I recently rooted my Toon and have several apps up and running like Buienradar and Afvalwijzer. The only app that just won't work for me is PostNL.

- I install the app through the Toonstore.
- I add the tile to the dashboard.
- I open the app by clicking the tile on the dashboard and add my credentials.
- "Bezig met inloggen... via PostNL" is showing on the tile forever. Nothing happens after.

Some info;
- Software version 5.22.14
- Toonstore 5.0.1
- PostNL 1.0.8

No idea what else I can do to make it work. Any suggestions?

Greetz, Tom
speedyconnalis
Starting Member
Starting Member
 
Posts: 10
Joined: February 2020

Re: Toon app: PostNL

Postby Toonz » Thu Feb 20, 2020 9:31 pm

The app isn't working at the moment. The last workaround has now also been blocked by the postnl website.
Maybe we will find another......
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby copywizard » Thu Feb 20, 2020 10:45 pm

sorry to hear ill just keep an eye out in this thread hopefully youl find a solution
copywizard
Starting Member
Starting Member
 
Posts: 7
Joined: February 2020

Re: Toon app: PostNL

Postby glsf91 » Sun Feb 23, 2020 12:08 am

Toonz wrote:The app isn't working at the moment. The last workaround has now also been blocked by the postnl website.
Maybe we will find another......


The login process has totally changed. They are using now OpenId.
Good News is I have it working now fully automated with Javascript in Postman for my account. I have to test if it is still working after a few days.
glsf91
Member
Member
 
Posts: 109
Joined: September 2017

Re: Toon app: PostNL

Postby speedyconnalis » Sun Feb 23, 2020 9:45 am

Toonz wrote:Good News is I have it working now fully automated with Javascript in Postman for my account. I have to test if it is still working after a few days.


Job well done! Hoping for good News and an update soon! :)
speedyconnalis
Starting Member
Starting Member
 
Posts: 10
Joined: February 2020

Re: Toon app: PostNL

Postby Toonz » Sun Feb 23, 2020 10:35 am

glsf91 wrote:The login process has totally changed. They are using now OpenId.
Good News is I have it working now fully automated with Javascript in Postman for my account. I have to test if it is still working after a few days.

Good job. Either send me your postman details or implement yourself in the Toon app and create a pull request on github :-)
Looking forward to the results. Well done.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby glsf91 » Sun Feb 23, 2020 12:19 pm

Toonz wrote:
glsf91 wrote:The login process has totally changed. They are using now OpenId.
Good News is I have it working now fully automated with Javascript in Postman for my account. I have to test if it is still working after a few days.

Good job. Either send me your postman details or implement yourself in the Toon app and create a pull request on github :-)
Looking forward to the results. Well done.


Maybe I give it a try to implement (I'am new in QT). For this first a few questions:
(I have read the Developing Toons Apps pdf)

- is there function available for doing a sha256 hash (if yes what is the name)?
- is there function available for generating random bytes (if yes what is the name)?
- more general: how do I know which QT modules and there contents are available at the Toon?
- can i run most of the PostnlApp.qml in QT quick designer (especially the refreshPostNL* stuff) ?
(easier to debug)
if yes, do I need QT quick designer or QT designer?
glsf91
Member
Member
 
Posts: 109
Joined: September 2017

Re: Toon app: PostNL

Postby Toonz » Sun Feb 23, 2020 2:04 pm

Hi glsf91,

I use this function in another app to generate a random string, maybe you can tweak it to your wishes:

Code: Select all
function randomStr(len) {
  var ranStr = '';
  var arr = "abcdefghijklmnopqrstuvwxyz0123456789";
  for (var i = len; i > 0; i--) {
     ranStr +=  arr[Math.floor(Math.random() * arr.length)];
  }
  return ranStr;
}


I don't use QT Designer, I have a second Toon2 which I use for developments.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby Toonz » Sun Feb 23, 2020 2:31 pm

glsf91 wrote:- is there function available for doing a sha256 hash (if yes what is the name)?

Not that I know of but maybe you can use this and include the js files:
https://github.com/brillout/forge-sha256
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby glsf91 » Sun Feb 23, 2020 6:12 pm

@Toonz
I now have a problem that with xmlhttprequest as it is always following a redirect. I do not want this because I need to capture something in between.
Do you know there is another way to do a POST request on the Toon (maybe with example)?

And which version of QML /QT is running in the Toon?
glsf91
Member
Member
 
Posts: 109
Joined: September 2017

Re: Toon app: PostNL

Postby Toonz » Sun Feb 23, 2020 8:08 pm

glsf91 wrote:@Toonz
I now have a problem that with xmlhttprequest as it is always following a redirect. I do not want this because I need to capture something in between.
Do you know there is another way to do a POST request on the Toon (maybe with example)?

And which version of QML /QT is running in the Toon?

Unfortunately xmlhttprequest is automatically following redirects, you can't prevent this as far as I know.
Alternative option: use a script file where you do your magic using curl. This file can be executed regularly via a crontab job or alternatively I can expand the tsc script to start it on request of the postnl app.
If the script saves the resulting inbox file I can pick it up in the app again.

I believe the Qt version is 5.1 but can be another 5.x release.
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1324
Joined: December 2016

Re: Toon app: PostNL

Postby glsf91 » Mon Feb 24, 2020 11:15 pm

Toonz wrote:Alternative option: use a script file where you do your magic using curl. This file can be executed regularly via a crontab job or alternatively I can expand the tsc script to start it on request of the postnl app.
If the script saves the resulting inbox file I can pick it up in the app again.


This indeed a better option. It gives me more control. This also means I can also use this in other systems like Domoticz.
I made a rough version of the shell script already and it is working for the inbox. I don't know if letters is also going to work because it is from a different source (mobile).
I need to add error checking stuff.
Sometimes it is not working because of invalid hashes I think. I have to debug this further.
So will take some time but there is progress.
glsf91
Member
Member
 
Posts: 109
Joined: September 2017

Previous

Return to Toon Apps

Who is online

Users browsing this forum: No registered users and 1 guest