🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by Steve Wed, 31 May 2000 00:00
[slrn] Piping an article to a bash script to view attachment.
#62031
Author: Steve
Date: Wed, 31 May 2000 00:00
36 lines
1934 bytes
I've been using slrn for over six months now and have recently tried to put a 
simple bash script together that will decode a message and show me the attached 
image.

The main problem being that the majority of messages in the group that I read
don't contain a begin line, I can save these files to disk and slrn will decode
them for me, but if I pipe to a script like this:

uudecode -o~/News/tmp.jpg
display tmp.jpg 

uudecode complains that there is no begin line (as there usually isn't).  

The way I currently get round this is ":" to save the file, use the mouse to 
mark the file name from the post, go into another rxvt and open ImageMagic
with the image, go back to slrn to read what the artist has to say about the
image, go back and open up the image again and have a second look, (I normally
close the image the first time because 1. I might not go back to it and 2.
I'm to lazy to use the & key and 3 I'm going to need that command line again 
soon.

If anyone knows of a better way of doing this please let me know.

-- 
Cheers
Steve              email mailto:sjlen@ndirect.co.uk

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.ndirect.co.uk/~sjlen/

or  http://start.at/zero-pps

  8:34pm  up 5 days,  7:28,  1 user,  load average: 2.18, 2.23, 2.21

Re: [slrn] Piping an article to a bash script to view attachment.
#62038
Author: John E. Davis
Date: Wed, 31 May 2000 00:00
34 lines
1526 bytes
On 31 May 2000 01:05:37 GMT, Steve <sjlen@ndirect.co.uk>
wrote:
>I've been using slrn for over six months now and have recently tried to put a 
>simple bash script together that will decode a message and show me the attached 
>image.

Use the uudecode program distributed with slrn (make uudecode), and
rename it to slrn_uudecode.  Then create a shell script called uuxv
with the line:
#v+
  (slrn_uudecode --stdout $1 | xv - &) <&0
#v-

Finally, use the macro:

#v+
define xv_view_article ()
{
   call ("art_bob");
   
   if (re_search_article ("^begin \\d+ "))
     pipe_article ("uuxv");
   else
     pipe_article ("uuxv -64");
}
definekey ("xv_view_article", "v", "article");
#v-

The net result is that pressing `v' will fire up xv and display the
encoded image.

--John

Re: [slrn] Piping an article to a bash script to view attachment.
#62155
Author: Steve
Date: Sat, 03 Jun 2000 00:00
49 lines
1795 bytes
On 31 May 2000 03:42:27 GMT, John E. Davis wrote:

Thanks John this did the trick.  Now how can I make it recognise
and open multiple attachments, I've got it using the display
utility of ImageMagic, I can't get XV to compile.  Any pointers
to get the multiple attachments thing would be great, but this
has already made life so much easier as it is. 

Thanks
Steve

>#v+
>  (slrn_uudecode --stdout $1 | xv - &) <&0
>#v-
>
>Finally, use the macro:
>
>#v+
>define xv_view_article ()
>{
>   call ("art_bob");
>   
>   if (re_search_article ("^begin \\d+ "))
>     pipe_article ("uuxv");
>   else
>     pipe_article ("uuxv -64");
>}
>definekey ("xv_view_article", "v", "article");
>#v-
>
>The net result is that pressing `v' will fire up xv and display the
>encoded image.
>
>--John


-- 
Cheers
Steve              email mailto:sjlen@ndirect.co.uk

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.ndirect.co.uk/~sjlen/

or  http://start.at/zero-pps

  9:54pm  up 3 days, 21:25,  2 users,  load average: 2.17, 2.13, 2.04

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads