<<< Date Index >>>     <<< Thread Index >>>

Script to find list email at gmane.org



Hi,

I like to bookmark useful mailing list threads in my web browser using
the web archive provided by the HTTP/NTTP/mailing list gateway
gmane.org. I've written this very simple shell script which I call from
within mutt using a macro to pull up the email in gmane. 

#!/bin/sh

GMANE="http://mid.gmane.org/";
MESSAGEID=`grep "^Message-ID:" - | head -1`
MESSAGEID=`echo $MESSAGEID | sed 's/^.*<//' | sed 's/>$//'`
URL="$GMANE$MESSAGEID"
open $URL

It uses Mac OS X's extremely useful "open" command, which accepts URLs
or files as its argument, with an optional application. If no
application is specified (as here) it uses the default handler for that
URL/file. In this case, it launches the default web browser.

macro index G '<pipe-message> ~/.mutt/gmaneview.sh'\n 'view list message in 
gmane'
macro pager G '<pipe-message> ~/.mutt/gmaneview.sh'\n 'view list message in 
gmane'

Known problems 
--------------

The last line must be modified to work on platforms other than OS X. I
tried "firefox $URL", which works if Firefox is already open, but fails
to return control to the shell if it isn't, i.e. I didn't get  "Press a
key to continue..." until I closed that instance of Firefox. It is also
not useful if the user uses a browser other than Firefox (information I
understand is available through the alternatives system in Debian-like
Linuxes).

I'd welcome help fixing this problem, or suggestions for any other
improvements.

-- Mike