Quote:
Originally Posted by Zaela
[You must be logged in to view images. Log in or Register.]
There is a bit of a ghetto/unreliable way to find the most recent version in a reasonable amount of time. Not perfect, but seems like it would have worked for the past year and a half, and reasonable to think it might continue to work in the future.
If you look at http://www.project1999.com/forums/forumdisplay.php?f=11, all the threads with patch downloads in them have the standard spiel ("The latest patch contains new required files. Download and extract the Project 1999 Files (V##) to your EQ Titanium Directory.") in their tooltip. A single simple http request will net you those tooltips, and a regex for "V\d+" or somesuch over the entire http response should get you the most recent version number along with a few recent but outdated ones. Should take less than a second. Don't need to be logged in to the forums or anything, either. And once you have the highest version, you can work backwards from that to the patch file url.
Relies on several assumptions being true, like the most recent patch being on the first page of that subforum (pretty likely), the post with the most recent patch having that standard spiel in its first line so it ends up in the tooltip (again, seems consistent over the past year and a half as far as I can tell), etc... but there you go.
Not ideal obviously, but something you could jump on right now rather than waiting for an official response and action that may never come.
|
Yeah, that's just the sort of hackish thing I'd like to avoid :/ I'd rather have a less error prone way of getting the latest patch in a programmatic way. I'd be more than willing to share the results of my work once I get something working.
The other way I thought of doing it, rather than trying to parse through the forum posts, was just working off the somewhat predictable ZIP file name and location. Currently it seems to look like this:
http://www.project1999.com/files/P99FilesXX.zip (with XX being the patch number). I could probably just scan for that pattern and get the highest patch number I can find, then cache the result locally and use that as a starting reference point for future checks.
But I'd rather have a less error prone way of doing this. I wouldn't think that setting up and master URL for the most current version and a simple JSON response (or even just a page that returns only a version number) would be very time consuming. And it could be used to build a tool that would eliminate a lot of frustration and inevitable forum posts with people having issues copying the ZIP to their directories each patch cycle.