How about a nice txt file with the version in on the site.
i.e
www.mirc.com/version.txt and it at the moment it would just say 6.1?
If you know how to script you can open a socket to the mirc homepage and filter *mIRC * has been released* to get the current version and date.
are u referring to something like this
http://www.mirc.co.uk/versions.txt ... you could then use the top line i believe to get the version from ..... either that or maybe in the whatsnew link u could pull it in there. if all your wanting is a txt file to retrieve version info to make an updater script from im going to guess that would be about the only current method i can think of.
If you were to read the first line of (
http://www.mirc.co.uk/versions.txt) that file, you would notice it has the up-to-date version number at the top. Perhaps this is what you are looking for?
EDIT: touche` d3m0n >:D Also, my reply was tot he previous poster, not the second >:D
Can we confirm that versions.txt will always be "date - version"?
Yes, but I would recommend referencing a different document on the site for that information.
The versions.txt is one of the larger documents and so would waste the most bandwidth in retrieving. There are other documents such as
http://www.mirc.co.uk/whatsnew.txt that are slightly smaller... but I would agree that a
currentversion.txt file should be added to the site to save everyone a little bandwidth.
- Raccoon
$wildtok(<readline>, *.*, 1, 32)
EDIT: Better yet, use:
$wildtok(<readline>, v*.*, 1, 32)
Although Racoon seems to think you can be 100% sure that it will always be date - version, I disagree. versions.txt is meant for reading, not parsing. Maybe one day Khaled might decide version - date looks nicer, it's a text file, that kind of change is something that should be expected. Formats for text files change all the time.
Additionally, saying it will _always_ be that way is imho flat out wrong. You can verify this by looking through the file:
27/04/96 - mIRC v4.1 (final bugfix release)
20/03/96 - mIRC v4.0 (final version)
13/09/95 - released mIRC v3.64 patch
13/08/95 - mIRC v3.51 (minor update)
29/06/95 - mIRC v3.42 (minor update)
21/06/95 - mIRC v3.3, v3.4
26/03/95 - mIRC v2.8c etc...
So you can see that it is NOT true that it will always be date - version because I've just shown 7 examples where it wasn't.
And that would be where my $wiltok example would play a role. Look for the version "template" if you will that always begins with a v, and contains a decimal.
Right, but I'm saying, if other parts of the format have changed, what is to say other's won't as well? Maybe he'll drop the "v" one day, maybe he'll make it "version" none of us know, so we shouldn't answer a question such as "will it _always_ be like that" since none of us can answer that with absolute certainty.
Thats what regular expressions are for.
And no, it wasn't my intent to suggest that Khaled will always keep the same format, but meant to confirm this is how he has historically formatted the file.
If he's really intent on checking for new versions, I'd suggest comparing the HTTP HEAD info for versions.txt and see if it changes size. That way it only sends 100 bytes or so instead of several K.
Regexp onluy goes so far. I mean what if he decided to change it to
"New Version is 6.1b(released ...)"
Would he change it to a format like that? Probably not, but you really couldn't handle something that handles every case. Even something like doing (.*\..*) well what if instead of MM/DD/YY he does MM.DD.YY, now that will screw up your regex.
Another, even smaller responce, which also allows to d/l the file IF it has been changed,
Get .....
if-modified-since: <day, date time GMT>