[REBOL] Re: [OT] Post #
From: SunandaDH::aol::com at: 24-Jan-2006 16:35
Hallvard:
> How does one tell the number of a messages in the rebol.org archive?
Here's three ways you can use:
[use the number format]
If you know number, put it directly into the URL -- both of these get you the
same message:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlJGRC
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rml239999
The clues you need to make sense of this are:
* the m= parameter always starts "rml" as a ML identifier. Means
we could support other Mailing lists in future;
* the first message number is 200'000. We started there so we'd have
100'000 numbers reserved for whenever software archaeologists found
us earlier messages than the archive's start date. (plus another 100'000
reserved for other uses);
* the letter format is not case sensitive;
* we use the letter format publicly because that's more google-friendly.
[use Library Data Services]
do
http://www.rebol.org/library/public/lds-local.r
probe lds/send-server 'get-rml-message ["jgrc"]
* the structure that comes back contains the msg-id as an integer
[reverse engineer the letters-to-integer algorithm]
The note in the source code says the algorithm is explicitly intended to give
people some fun in trying to reverse engineer it. So look away now if you
don't want to be handed the answer on a plate:
.
.
.
.
.
.
.
.
do
http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=base-convert.r
rml-base-letters: copy "NPRHDWVMTGBSKJQCFYLXZ"
msgid: copy "JGRC"
100000 + base-convert/from-base head reverse copy msgid rml-base-letters
== 239999
head reverse base-convert/to-base (239999 - 100000) rml-base-letters
== "JGRC"
Sunanda