Article View: news.software.readers
Article #38372Re: SLRN and scoring based on message body?
From: John E. Davis
Date: Fri, 30 Jan 1998 00:00
Date: Fri, 30 Jan 1998 00:00
106 lines
3059 bytes
3059 bytes
On 24 Jan 1998 17:01:49 GMT, Sven Guckes <guckes@math.fu-berlin.de>
wrote:
>> Also, can SLRN search all articles for a string?
>
>I think there are only commands to search within the From and Subject only.
A macro can be used. The functions that I use are included below.
Basically, these macros define two searches:
1. Search the current newsgroup
2. Search using the altavista search engine
The function `easy_search' causes a box to pop up that queries which
of the two searches to make, and then calls the appropriate function.
I bind it to `$'.
[Note: The altavista search used to work. The altavisa server may
have changed, so I make no guarantees about it.]
---------------------------------------------------------------------
variable Last_Art_Search_Str = "";
define search_newsgroup ()
{
variable str;
variable flags;
str = read_mini ("Search for regexp", Last_Art_Search_Str, "");
!if (strlen (str))
return;
Last_Art_Search_Str = str;
uncollapse_threads ();
do
{
flags = get_header_flags ();
if (re_search_article (str))
{
pop ();
return;
}
set_header_flags (flags);
call ("hide_article");
% update ();
}
while (header_down (1));
error ("Not found.");
}
define altavista_search ()
{
variable browser = "lynx";
variable url = "http://www.altavista.digital.com/";
variable cgi = "cgi-bin/query?pg=q&what=news&fmt=.&q=";
variable str, new_str, len, ch, chlo, i;
variable cmd;
str = strcat ("+newsgroups:", current_newsgroup ());
str = strcat (str, " +");
str = read_mini ("AltaVista Search", "", str);
len = strlen (str);
!if (len) return;
new_str = "";
for (i = 0; i < len; i++)
{
ch = str [i];
chlo = ch | 0x20;
if ((chlo > 'z') or (chlo < 'a'))
ch = Sprintf ("%%%02X", ch, 1);
else
ch = char (ch);
new_str = strcat (new_str, ch);
}
cmd = Sprintf ("%s '%s%s%s'", browser, url, cgi, new_str, 4);
() = system (cmd);
}
define easy_search ()
{
variable rsp;
rsp = get_select_box_response ("NewsGroup Searches", % title
"AltaVista (WWW)",
"search articles",
2);
if (rsp == 0) altavista_search ();
else if (rsp == 1) search_newsgroup ();
}
definekey ("easy_search", "$", "article");
Technical Details
Message-ID:
<slrn6d2dd3.n5p.davis@mygir.davis.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.mbox.zip!not-for-mailReferences:
<slrn6chvur.rsr.sal@panix3.panix.com> <slrn6ck7js.9ks.guckes@rudin.math.fu-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <slrn6d2dd3.n5p.davis@mygir.davis.net> Subject: Re: SLRN and scoring based on message body? Date: Fri, 30 Jan 1998 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <slrn6chvur.rsr.sal@panix3.panix.com> <slrn6ck7js.9ks.guckes@rudin.math.fu-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 320708717 Organization: Center for Space Research Newsgroups: news.software.readers