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

Re: viewing URLs (muttils or lynx?)



On Wednesday, March 26 at 09:59 AM, quoth Robert Svoboda:
* Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> [2008-03-26 07:40]:
On the thought that just parsing <a> links would be sufficient, I whipped up a little perl script based on what I've done for extract_url.pl. I call this little script "tagurl.pl". I'm not completely satisfied with it yet, but it's a start. What do you think?

I tried to write it myself (bash) but I'm not good at it so it takes its time. Your code seems to do much better job than mine.

Well, that's perl for you: blazing fast at text manipulation. I'm a bit of a bash wizard m'self, but getting great performance out of bash at that sort of thing requires using bash's built-in functions, which are somewhat limited (e.g. ${variable//search/replace}).

BTW, there is semicolon missing at the end of line 56.

Ah, right! Good catch. :)

I also noticed that my getopts call was missing an 's' at the end, so argument handling was completely broken. Attached is a fixed version.

OR as a $display_filter  that extracts/tags links from plaintext.

I can confirm that this works. Great work Kyle. Thanks a lot for sharing it.

Excellent! :)

~Kyle
--
Some people are afraid of heights. Not me, I'm afraid of widths.
                                                      -- Steven Wright

Attachment: tagurl.pl
Description: Perl program

Attachment: pgpaeahkvfMOR.pgp
Description: PGP signature