🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #204526

Re: How to access a post by Message-ID

#204526
From: »Q«
Date: Wed, 22 Aug 2007 23:29
47 lines
3220 bytes
In <news:slrnfbb73c.l9g.stefano.sabatini@santefisi.caos.org>,
Stefano Sabatini <stefano.sabatini@caos.org> wrote:

>I already had my script, which I'm going to publish for the archive.

Hi Stefano -- I hope you're still reading.

>Enjoy the getopt parsing in bash!

Thanks again for this.  I ended up using getopts instead, since it's a
bash builtin, but I never would have found it if you hadn't pointed me
that way.

I've been playing with my script in order to learn more about bash (and
sed), and now it's got a lot of options I'll never need.  ;)

># freenix.org mode
>#url_base='http://howardk.freenix.org/msgid.cgi?STYPE=msgid&MSGI='
>#mangled_message_id=$(echo "%3C${message_id}%3E" | \
>#sed -e 's/%\([[:alpha:]]\)/%25\1/g' | \
>#sed -e 's/@/%40/g')
>#
>#url=${url_base}${mangled_message_id}

There are problems with this, but since it's commented out they don't
really count as errors.  ;)

The freenix URLs require more encoding than just the < brackets > and @
and %.  For an example, try <faf751$2mj9$2@sage.ukr.net> -- the $'s
need encoding.

Also, the expression %\([[:alpha:]]\) won't catch all the % characters.
Consider something like <foo%@example.com>.

Without a lot of actual MIDs to test, it's hard to say, but my guess is
that the freenix URLs need to have all special characters encoded.  Any
% characters should be encoded first, then the others in any order.  I
think I've made a complete list of characters which are legal in MIDs
but which need encoding in http URLs.  There's a string of sed commands
for them in the current version of the script.

The script is at <http://remarqs.net/misc/mids2urls.sh.txt>.  I think
it's all ok, but I've been tinkering with it today and haven't tested
much to see if I've broken anything.

-- 
»Q«
Technical Details
Message-ID: <vetup4-2f2.ln1@goldry.remarqs.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <slrnfb8lfe.usu.stefano.sabatini@santefisi.caos.org> <omnfo4-nbq.ln1@goldry.remarqs.net> <slrnfbb73c.l9g.stefano.sabatini@santefisi.caos.org>

Show Full Headers
Complete Article Headers
Message-ID: <vetup4-2f2.ln1@goldry.remarqs.net>
Subject: Re: How to access a post by Message-ID
Date: Wed, 22 Aug 2007 18:29:02 -0500
From: »Q« <boxcars@gmx.net>
References: <slrnfb8lfe.usu.stefano.sabatini@santefisi.caos.org> <omnfo4-nbq.ln1@goldry.remarqs.net> <slrnfbb73c.l9g.stefano.sabatini@santefisi.caos.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Organization: none
Lines: 47
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net nftcGdN1khHm1yZdxUMdTArFWa6qTMHAyPfAdDFP9wPvxJLp7Y
X-Orig-Path: goldry.remarqs.net!news
Cancel-Lock: sha1:bNZq1rIoIrhtD5A4AcCO8PyeXDg=
X-Newsreader: Claws Mail 2.9.2 (GTK+ 2.10.13; i686-pc-linux-gnu)
X-Face: *#`F(_&o, GRH~~$V&ByU1LZAWc]JgxuT`Pv2y0`&JE`(=*PcC>#m2]xv]p,
 i|9mDJ+8dGMJl`V[!z]\N}qrLTHjU]Sew>rQBShT_8.(0Q(iH,
 Gu7k|y/)^!@oVydVrix*#|-|u2~zgA'U3nQ_fa#jXvcGL[9f:>8?U=hXYK3D~*}Gq$TjPe1WXEFLGTiB3ot!oMH"'(Jop0(\0C
X-No-Archive: yes