wololodev / d2mt

Competitive coverage on the go!
37 stars 11 forks source link

Fix JD matches only supporting 5 char IDs #8

Closed MasterOdin closed 10 years ago

MasterOdin commented 10 years ago

not sure which is the currently used API (v130 I think?)

apply as necessary, but this will obviously allow for the JD link to work so long as they don't change the site HTML anytime soon (so it'll work if they ever hit 7 character IDs).

MasterOdin commented 10 years ago

Fixes #7

wololodev commented 10 years ago

holyshit the PHP and directory structure makes me cringe ^_^.. Not sure how you can deal with it! Legacy code ftw :3

wololodev commented 10 years ago

What was this supposed to fix ? I get same bugs in my localhost when testing (missing $id)

MasterOdin commented 10 years ago

Changing that line changes the result from:

04361
04359
01197
04375
04767
01195
04765
05757
04637
05151
05149
05147
05145
05617

to:

104361
104359
101197
104375
104767
101195
104765
105757
104637
105151
105149
105147
105145
105617

should not be throwing errors from this line change. (I did get other errors on parsing on line 29 though, so who knows!)

Essentially, match ids are scraped and the link is: score###### where the current API grabs -5 characters (so not the entire ID number). Instead of changing it to -6 (which would also potentially work), change it to just get rid of the score and not worry about how many potential numbers there are. This would theoretically work longer barring some major site redesign (in which case the API would probably need to be rewritten anyway).

wololodev commented 10 years ago

I'm giving you permission to push to master since I'm too busy to maintain this project. I can also give you FTP access + WHM/cPanel so you can pull to remote (prod). Let me know if that's something you're willing to do.

MasterOdin commented 10 years ago

I'd definitely be willing to do that as this is a pretty great extension I use pretty daily. Shoot me an email at matt.peveler@gmail.com.

Of course, right now, my biggest question is what API should the extension be using as it seems like there are two newer versions for matches and it doesn't use it? Is that an oversight or by design?

Because it seems like there are multipe things that need to be fixed on the JD API (dates are all wrong as well as one of the tabs being blank and I guess there's supposed to be a line above the dates which is supposed to be tournament name maybe?). Need a bit more info on what the expected outcome is supposed to be before I'd want to approach fixing it fully.