Re: tagurl.pl
- To: mutt-users@xxxxxxxx
- Subject: Re: tagurl.pl
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Mon, 19 May 2008 20:29:16 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=K8+P+3qieH+5bN+0LmM989OrPPI=; b=OOgn yBFuFMwrwQEuX/5QR0321iXIf5RDl+6In2eqeWYdDhBnn57EMh5nXn2nsvuFncI/ s7HEcNXEIG9h5BpCQKqGI/mcyr4JlEJJlyCdMWBBl9/CMmsNozMJGoxqwDnEcYuz u+Ky1gJ9EGF1+mAmEW6adJe+Noj6OliW96m+EAA=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=CBoVXd7uhEH1GuVhLqkNm3e9JVSA703b+Rqtl66Efn0z/EdHk3L+Z8WKj+JYrY3ZOFuSB6cI34x+msYbwb68jLjWOHOnQM2ZIU498joihZSFFq2Td9fDhVDUwNayt2F/F8OnmRCzCW0Ezve1cF++XMfMy1Jqv38plFjPTF3YSy8=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20080520003317.GE76164@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20080519204512.GB14685@xxxxxxxxxxxxx> <20080520003317.GE76164@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.18 (2008-05-19)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday, May 20 at 08:33 AM, quoth Wilkinson, Alex:
> 0n Mon, May 19, 2008 at 03:45:12PM -0500, Kyle Wheeler wrote:
>
> > I put up a webpage for my tagurl.pl script:
> > http://www.memoryhole.net/~kyle/tagurl/
>
> After having a quick read of the page I still dont really get what
> this script does :(
Hmmm... well, so here's the problem it's addressing: at the moment, if
someone sends you an email with a URL in it that you want to open,
what you have to do is either copy and paste the URL from your
terminal, or rely on your terminal to identify URLs and launch your
web browser (like Gnome's terminal does), or use something like
urlview to extract URLs and feed them to your web browser.
All of that is a bit of a pain, even after you have it set up. It
would be awfully nice if mutt recognized URLs in email and allowed you
to open them directly. For example, if mutt allowed you to open the
first URL in an email simply by pressing 1 or the second URL simply by
pressing 2 (while viewing that email). See what I mean?
This script can be used to (more-or-less) achieve that. When you feed
it the body of an email (either HTML or plain text) it finds the URLs
in it and generates a file containing some mutt macros that look
something like this:
macro pager 1 "<shell-command>firefox http://url1/<enter>"
macro pager 2 "<shell-command>firefox http://url2/<enter>"
macro pager 3 "<shell-command>firefox http://url3/<enter>"
Thus, if you tell mutt to load (i.e. "source") that file, those macros
will be defined, and you can then launch firefox (or whatever browser
you prefer) from mutt with a single button press.
To get this to all happen smoothly, you need to have mutt do some work
every time you view a message: first it needs to feed the message to
this script (which will generate that file full of macros), then it
needs to read in that macro file. I gave some reference hooks that you
can use to tell mutt to do that.
The next problem, logically, is it'd be nice to know (while viewing a
message) which URLs map to which number to press, so that you know
what to press to view the relevant URL. This script outputs a "tagged"
version of the email. What I mean by that is that it transforms plain
URLs:
http://www.google.com
http://www.yahoo.com
Into tagged ones:
[1]http://www.google.com[1]
[2]http://www.yahoo.com[2]
That way you know that if you press 1, mutt will launch firefox with
the google address, and if you press 2, it will be launched with the
yahoo address. Make sense?
~Kyle
- --
A wise man changes his mind, a fool never.
-- Spanish proverb
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iEYEARECAAYFAkgyKWwACgkQBkIOoMqOI14d5ACghGMNPiw/aZG2LwrGE+rAgVXy
ZeoAn1YVVyd8ZwxXkrVpBvln7o3WQ6qC
=ODLO
-----END PGP SIGNATURE-----