Archive for March 10, 2010
Urlview – URL extractor/launcher
One day, I was browsing through the conf files in /etc in Fedora. I came across a file “urlview.conf”. On further looking, I came to know there exists a program “urlview” to extract URLs from text files and display a menu from which you may launch a command for a specific URL.
To get started, urlview needs to identify the configuration. For this it looks for ~/.urlview and /etc/urlview.conf in that particular order. If no configuration commands are specified in the two files, it uses the default configuration.
The configuration is as follows :-
REGEXP regexp
COMMAND command
where
| regexp | : | regular expression to be used to extract the URLs from the text files. |
| command | : | command to be executed on selecting a URL from the list of the extracted URLs. If the specified command contains a %s, it will be substituted with the URL that was requested, otherwise the URL is appended to the command string. |
(The order of the two options doesn’t matter.)
The default configuration is :
REGEXP (((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):] COMMAND url_handler.sh %s
I hope this tiny utility will be fun to use for all of you.
Recent Comments