oskutka / rhlp

25 stars 23 forks source link

Moname doesn't work since the web change #44

Closed nertpinx closed 6 years ago

nertpinx commented 6 years ago

I figured out that the following selector works quite nicely on the page:

.wpb_wrapper > p[align='CENTER']:nth-child(n+5) > span[style='color: #000000;']

But it's not enough to change that and the server-side needs a change too, probably. However I don't have anything java related to spin up the whole dev env just to try it out, sorry. Anyway the change they made is mostly the fact that there is only the menu for today, there is no day mentioned there and it has a different structure.

oskutka commented 6 years ago

Works like a charm! Thanks!

nertpinx commented 6 years ago

One more thing (just found that out) is that they don't update the menu early enough, so maybe there should be a check that the day is correct, in other words only if:

document.querySelector(".wpb_wrapper > p[align='CENTER']:nth-child(4) > span[style='color: #000000;'] > span[style='font-size: large;'] > u > b").innerText == "Polední nabídka " + t.getDate() + "." + (t.getMonth() + 1) + "." + t.getFullYear()

where t = new Date();

Otherwise it might be displaying the menu from previous day. Of course you can also choose to check the date or just change the first selector to include the first line so that it is visible for which day it is.

Sorry for the trouble :disappointed:

oskutka commented 6 years ago

The problem is that the page is cached on server, so this logic needs to go there rather then to a client.

nertpinx commented 5 years ago

Also they stopped updating the menu two days after this issue was closed. Maybe disabling Moname is better than showing old menu now :(

triceo commented 5 years ago

@nertpinx @oskutka Moname is dead. This is their last week. It should probably be removed from the website altogether.