🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #38242

Re: SLRN and scoring based on message body?

#38242
From: Holger Lillqvist
Date: Sat, 24 Jan 1998 00:00
121 lines
3622 bytes
Quoting Salvatore Denaro <sal@panix3.panix.com>:
> Subject says it all. Any chance that this can be done?
> 
> Also, can SLRN search all articles for a string? Anyone have an
> example slang script to do this? 


JED once answered on such a request, see below. - One reason why
scoring on body strings proabably not will be implemented is of
course that it would be extremely slow. An occasional body search in
a newsgroup is another matter, but anyway you sure want to change
screen and work with something else while the search is running...

Here is the JED quote:


On 4 Apr 1997 08:48:43 GMT, J.H.M. Dassen <jdassen@wi.LeidenUniv.nl>
wrote:
>Is it possible in slrn to score on words in the body of messages? If so,
>is there an example file available?

   No, I did not add scoring on the body of the message.  It is
extremely unlikely that I would ever do so; however, you should be
able to write a macro to do body searches (see what I use below).

< clip >

Here is the body searching macro.  See slrn/doc/README.macros for more
information. (There are actually two searches: one that searches
articles on the server and the other uses www.altavista.com)  

Note: you may need slrn/macros/util.sl loaded.


!if (is_defined ("Search_Altavista_Browser"))
{
   variable Search_Altavista_Browser = "lynx";
}

variable Search_Last_Art_Search_Str = "";
define search_newsgroup ()
{
   variable str;
   variable flags;
   
   str = read_mini ("Search for regexp", Search_Last_Art_Search_Str, "");
   !if (strlen (str))
     return;

   Search_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");
     }
   while (header_down (1));
   
   error ("Not found.");
}

define search_using_altavista ()
{
   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'", Search_Altavista_Browser, 
		  url, cgi, new_str, 4);
   () = system (cmd);
}

define search_easy_search ()
{
   variable rsp;
   rsp = get_select_box_response ("NewsGroup Searches",   %  title
				  "AltaVista (WWW)",
				  "search articles",
				  2);

   switch (rsp)
     { case 0: search_using_altavista (); }
     { case 1: search_newsgroup (); }
}
definekey ("search_easy_search", "$", "article");

Technical Details
Message-ID: <slrn6ck9sq.k99.lillqvis@kontti.Helsinki.FI>
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
References: <slrn6chvur.rsr.sal@panix3.panix.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn6ck9sq.k99.lillqvis@kontti.Helsinki.FI>
Subject: Re: SLRN and scoring based on message body?
Date: Sat, 24 Jan 1998 00:00:00 +0000
From: lillqvis@cc.helsinki.fi (Holger Lillqvist)
References: <slrn6chvur.rsr.sal@panix3.panix.com>
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: 319076606
Organization: University of Helsinki
Newsgroups: news.software.readers