macro to fetch message-id's
Troy Piggins <[email protected]>
| Newsgroups | gmane.network.slrn.user |
|---|---|
| Message-ID | <[email protected]> |
Hi. I'm trying to hack a macro found here:
http://strcat.neessen.net/dotfiles/slrn/msgid.sl
I want to add a feature where if the message-id is not found on the
server/spool, it will open up the browser and use google groups to
bring it up on a webpage. See bottom of post for my effort so far.
Trouble is, I can't get my part/hack to work. As I understand the
select_list_box function, it should return the string selected, and
so the macro below assigns that value to variable 'mid'.
Then the locate_header_by_msgid function uses 'mid' to retrieve the
article and returns 1 if header found or 0 if not.
So I thought I could use that feature as shown below. Can't get it
to work and wondering what I am missing.
As a side question, I don't fully understand the original macro's
line that begins with "Which one?" - it seems that the strings on
that line get added in as arguments to the select_list_box function,
so why wouldn't they be placed inside the () as I've seen all other
functions?
Any help appreciated. Thanks.
define msgid_menu ()
{
variable fnd="",hvr,len,mid,m="",reg="<[^/ @]*@[^ @]*>",list,dl,i;
call("art_bob"); while (re_search_article(reg))
{ fnd = (); ()=string_match(fnd,reg,1);
(hvr,len)=string_match_nth(0);
substr(fnd,hvr+1,len); fnd = ();
if (string_match(fnd,"news:",1)) {fnd="<"+substr(fnd,7,-1);} m=m+fnd+",";
}
list = strchop (m,',',0); dl = length(list)-1;
!if (dl) {error("No msgid's found.");}
"Which Message-ID ?"; for (i=0; i<dl; i++) {list[i];} dl; 0; mid = select_list_box();
variable msg_found = locate_header_by_msgid(mid,1);
!if ( msg_found )
{
variable browser_url = sprintf( get_variable_value( "non_Xbrowser"),
"http://groups.google.com/groups?as_umsgid=");
() = system (sprintf (browser_url+"%s", msg_id));
}
}
definekey("msgid_menu","L","article");
--
Troy Piggins
Ubuntu 5.10 pkgs : kernel 2.6.12-9-386, postfix 2.2.4, procmail 3.22
Compiled from src : slrn 0.9.8.1/rt (score_color patch), mutt 1.5.11i
vim 6.4
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642