AEFeinstein / Mtgjson2Familiar

GNU General Public License v3.0
2 stars 0 forks source link

Current IPG doesn't appear in Judge's Corner #202

Closed AEFeinstein closed 11 months ago

AEFeinstein commented 11 months ago

Copied from https://github.com/AEFeinstein/mtg-familiar/issues/616:

The IPG (Infraction Procedure Guide) was updated on 2023-09-04. Though the current MTR, which was made available on the same date, appears in Judge's Corner, the version of the IPG that currently appears there is still that of 2021-02-05. Presumably this is because the new IPG is inexplicably unable to be easily found via the WPN or MTG websites, though it does exist on the former at this URL:

https://media.wizards.com/2023/wpn/marketing_materials/wpn/mtg_ipg_2023sep4_en.pdf

It can also be found on the Judge Academy website here:

https://judgeacademy.com/wp-content/uploads/2023/09/mtg_ipg_2023sep4_en.pdf

I expect that the best place to check for the current IPG henceforth will be on Judge Academy, at this page:

https://judgeacademy.com/mtg-documents/

Thanks for the excellent app!

AEFeinstein commented 11 months ago

This program is looking at the page source for https://wpn.wizards.com/en/rules-documents for the docs, but at some point it changed from having the links in HTML to having links in a <script> tag, so it's not finding updates.

jivanpal commented 11 months ago

Does your code actually execute the script in order to render the page, or does it just parse the HTTP response? If it does the former, could that be the reason why it could find the new MTR but not the new IPG? I say this because, for me, the page doesn't render the element of the JS array in that script that corresponds to the IPG. That is, I see all elements of that array (the data.fetch."DocumentationDownload:0".documents element of the object that the script function returns) rendered on the webpage, except for a few, the first of which happens to be the IPG, and the second of which is a Constructed deck registration sheet (element of the array with id: "7Ht11QxdDPGBd1Cg01HNfN") that should appear between the Midnight Hunt and Crimson Vow deck checklists.

AEFeinstein commented 11 months ago

It parses the HTTP response, no actual rendering. I updated it to check within <script> tags, which is a quick and good-enough hack for me. The HTML was updated in 9eb2aee6b23bb683f7e6b9938facc25b4ae08414. If you want to write a more sustainable solution, I'm open to it. That may be impossible unless you can tell WotC to stop changing their page, haha).

jivanpal commented 11 months ago

It might be a good idea to check Judge Academy in addition to WPN. At least then if one changes, the other is unlikely to have changed at the same time.

Thanks for the speedy fix! I'm seeing the new version in the app now 😊

AEFeinstein commented 11 months ago

I'll leave it to you if your want to write in a check for Judges Academy. It'd be somewhere over here https://github.com/AEFeinstein/Mtgjson2Familiar/blob/9eb2aee6b23bb683f7e6b9938facc25b4ae08414/src/com/gelakinetic/mtgJson2Familiar/JudgeDocConverter.java#L126C12-L126C12