[295] in World Wide Web

home help back first fref pref prev next nref lref last post

Re: Possibly of interest to readers of the c.i.www.* newsgroups

daemon@ATHENA.MIT.EDU (yandros@MIT.EDU)
Wed Jun 22 21:42:11 1994

From: yandros@MIT.EDU
Date: Wed, 22 Jun 94 21:41:47 -0400
To: mkgray@MIT.EDU
Cc: www@MIT.EDU, webmaster@MIT.EDU
In-Reply-To: "[292] in World Wide Web"


People who are interested in this might like the original version
better (in particular, the non-perl solution is, of course, much
faster).  I've appended the [slightly shortened] netnews post below:
  
  Article: 275 of comp.infosystems.www.users
  From: aubrie@chausey.inria.fr (aubrie claude andre)
  Newsgroups: comp.infosystems.www.users
  Subject: Re: Sending HTML posts to your browser from your newsreader
  Date: 13 Jun 1994 13:22:14 GMT
  Message-ID: <2thmi6$7a8@news-rocq.inria.fr>
  Mime-Version: 1.0
  Content-Type: text/plain; charset=iso-8859-1
  Content-Transfer-Encoding: 8bit
  
  In article <1994Jun8.164959.12608@ptolemy-ethernet.arc.nasa.gov>, chucko@freud.arc.nasa.gov (Chuck Fry) writes:
  |> [Sorry about the excessive inclusions/new text ratio... see the
  |> punchline below.]
  |> 
  |> In article <boutellCqzyDy.ECK@netcom.com>,
  |> Thomas Boutell <boutell@netcom.com> wrote:
  |> >Oftentimes, folks post HTML to newsgroups, or at least post messages
  |> >with a little bit of HTML (say, a few <A HREF... tags) in it.
  |> 
  |> >You can easily handle this, if you're using rn or one of its
  |> >descendants as your newsreader under Unix, by putting the following line
  |> >in your .rnmac file (create it if you haven't got one):
  |> 
  |> >W	|readwebpost %C\n
  |> 
  |> >And placing the following little script somewhere your path
  |> >will be able to find it (important):
  |> 
  |> >#!/bin/sh
  |> >echo \<PRE\> > .article.html
  |> >cat >> .article.html
  |> >echo \</PRE\> >> .article.html
  |> >lynx .article.html < /dev/tty
  |> >rm .article.html
  |> 
  |> >... Now, whenever you hit "W", the current article will be sent to
  |> >Lynx for your browsing pleasure.
  |> 
  |> Yes, but what if you're using Mosaic instead?  Is there any way to use
  |> it from *rn?
  |>  -- Chuck Fry, trying to remain Unix-ignorant
  |> -- 
  |>    Chuck Fry  Work: chucko@freud.arc.nasa.gov  Play: chucko@rahul.net
  |>  I speak for myself.  NASA and RECOM Technologies speak for themselves.
  
  A script exists which take a file.html as argument and call mosaic after 
  sending it a SIGNAL.
  I use it from Xrn, associated with the command Print, which I rarely use.
  
  Claude Aubrie			| Email: aubrie@chausey.inria.fr
  INRIA Centre de Rocquencourt	| Tel : +33 1 39 63 52 41
  BP 105				| Fax : +33 1 39 63 52 28
  78153 Le Chesnay Cedex (France)	| Telex : 69 70 33 F
  
  
  
  #!/usr/local/bin/perl
  #
  # showhtml	Metamail HTML viewer: Mosaic remote-controlling or launch
  #
  # Jean-Christophe.Touvet@inria.fr
  #
  $MTMP = "/tmp/Mosaic";
  $MEXE = "xmosaic";
  $FILE = ".mail.html";
  
  die "$0: incorrect #arguments\n" if $#ARGV;
  $HOME = $ENV{HOME} || die "HOME undefined\n";
  $file = "$HOME/$FILE";
  system ("/bin/cp",$ARGV[0],$file);
  
  if ($pid = &GetMosaicPid) {
  	$MTMP .= ".$pid";
  	open (F,">$MTMP") || die "$MTMP: $!\n";
  	print F "goto\nfile://localhost$file";
  	close (F);
  	print "\nLook at your Mosaic window to see $file\n";
  	kill ('SIGUSR1',$pid);
  	sleep 1;	# WARNING: might depend on your host's load
  	unlink ($MTMP);
  } else {
  	print "\nMosaic not yet running, spawning it on $file\n";
  	system ("$MEXE $file &");
  }
  
  # Searches for running Mosaic. Doesn't use .mosaicpid because it doesn't work
  # if you've opened then closed some other Mosaic window.
  sub GetMosaicPid
  {
  	open(PIDFILE, "ps -x |");
  	while (<PIDFILE>) {
  		if(/(\d+) .*$MEXE/){
  			close(PIDFILE);
  			return ($1);
  		}
  	}
  	close(PIDFILE);
  	return 0;
  }
  
  -- 
  Claude Aubrie			| Email: aubrie@chausey.inria.fr
  INRIA Centre de Rocquencourt	| Tel : +33 1 39 63 52 41
  BP 105				| Fax : +33 1 39 63 52 28
  78153 Le Chesnay Cedex (France)	| Telex : 69 70 33 F







home help back first fref pref prev next nref lref last post