Article View: news.software.readers
Article #47054Re: fetching expired articles with slrn
From: John E. Davis
Date: Thu, 04 Mar 1999 00:00
Date: Thu, 04 Mar 1999 00:00
66 lines
3336 bytes
3336 bytes
On 3 Mar 99 20:26:13 GMT, Peppe <c928400@student.dtu.dk>
wrote:
>How about the following:
>
> define dejanews_mid ()
> {
> variable mid, len, data, command;
>
> mid = read_mini ("Find which message ID on dejanews", "", "");
> mid = strtrim (mid);
> len = strlen (mid);
I would modify this to return is len == 0, otherwise mid[0] will
result in a range error:
if (len == 0)
return;
> if (mid[0] == '<' & mid[len-1] == '>')
> mid = substr (mid, 2, len-2);
Here you need to use 'and' instead of '&':
if ((mid[0] == '<') and (mid[len-1] == '>'))
mid = substr(mid, 2, len-1);
Also, if you are using a 1.3.x version of slang, you can use:
if ((mid[0] == '<') and (mid[-1] == '>'))
mid = mid[[1:len-2]];
> % Why doesn't this work?
> %mid = str_replace_all (mid, "+", "%");
It should work. See below.
[...]
>So far it works well for me, except when the ID contains a "+".
>Dejanews needs to have this character substituted by "%" (probably
>others as well). I tried to work around it using str_replace_all:
[...]
>before: Z+A5sCBRfm12EwIo@thunderbird-sport.freeserve.co.uk
>after: Z�sCBRfm12EwIo@thunderbird-sport.freeserve.co.uk
>
>Here "+A5" have been replaced by "�". Anybody know why?
The result should have been:
Z%A5sCBRfm12EwIo@thunderbird-sport.freeserve.co.uk
Is it possible that lynx is expanding "%A5" (although I would guess
that � is produced by %BE, but this difference may be due to character
set translations)? Perhaps you should try using, e.g.,
mid = str_replace_all (mid, "+", "%25");
so that lynx expands "%25" to "%".
--
John E. Davis Center for Space Research/AXAF Science Center
617-258-8119 One Hampshire St., Building NE80-6019
http://space.mit.edu/~davis Cambridge, MA 02139-4307
Technical Details
Message-ID:
<slrn7dtjm4.pap.davis@aluche.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.pine.mbox.zip!not-for-mailReferences:
<Pine.LNX.4.04.9902281839210.5878-100000@paule.ncpa.olemiss.edu> <36d9ff6d.641177409@nntp3.site1.csi.com> <slrn7dktrf.6tn.guckes@rudin.math.fu-berlin.de> <36dacea6.23183718@news.washburn.edu> <slrn7dlrof.6tn.guckes@rudin.math.fu-berlin.de> <Pine.WNT.4.10.9903011547180.-395821@aleph> <slrn7dnh2c.6tn.guckes@rudin.math.fu-berlin.de> <Pine.WNT.4.10.9903020911460.-421041@aleph> <slrn7dq7dj.edv.guckes@rudin.math.fu-berlin.de> <slrn7dr6m3.f16.c928400@urdybet.pbk.dk>Show Full Headers
Complete Article Headers
Message-ID: <slrn7dtjm4.pap.davis@aluche.mit.edu> Subject: Re: fetching expired articles with slrn Date: Thu, 04 Mar 1999 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <Pine.LNX.4.04.9902281839210.5878-100000@paule.ncpa.olemiss.edu> <36d9ff6d.641177409@nntp3.site1.csi.com> <slrn7dktrf.6tn.guckes@rudin.math.fu-berlin.de> <36dacea6.23183718@news.washburn.edu> <slrn7dlrof.6tn.guckes@rudin.math.fu-berlin.de> <Pine.WNT.4.10.9903011547180.-395821@aleph> <slrn7dnh2c.6tn.guckes@rudin.math.fu-berlin.de> <Pine.WNT.4.10.9903020911460.-421041@aleph> <slrn7dq7dj.edv.guckes@rudin.math.fu-berlin.de> <slrn7dr6m3.f16.c928400@urdybet.pbk.dk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.pine.mbox.zip!not-for-mail X-Deja-AN: 451235887 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@eecs-usenet-02.mit.edu X-Trace: eecs-usenet-02.mit.edu 920571591 17703 18.75.2.45 (4 Mar 1999 18:19:51 GMT) Organization: Center for Space Research Mime-Version: 1.0 User-Agent: slrn/0.9.5.4 (UNIX) Reply-To: davis@space.mit.edu NNTP-Posting-Date: 4 Mar 1999 18:19:51 GMT Newsgroups: comp.mail.pine,news.software.readers