[Surfraw-devel] More output configuration options

Sumant Oemrawsingh soemraws at xs4all.nl
Sun Oct 11 15:53:22 UTC 2009


On Fri, Oct 09, 2009 at 08:26:03AM +0100, James Rowe wrote:
> * Sumant Oemrawsingh (soemraws at xs4all.nl) wrote:
> > I also had an idea of expanding some elvi to also dump the html as parsed by
> > lynx or so, to the screen; great for wikipedia articles! No need even for
> > opening and running a browser, but read the article in the comfort of the pager
> > of your choice. I'm not sure, though, if this fits in the current way that
> > surfraw is laid out, or if it would be better to use surfraw to print the url
> > and have another surfraw-like collection of scripts to do the retrieving and
> > dumping. Anyway, this is something to be discussed in another thread, if at
> > all. I'll look into it a bit more and will post a new message here when I have
> > it figured out.
> 
>   I can see it being useful, and I've actually used surfraw in a similar
> way a number of times in the past:
> 
>     1. Edit some code in vim, and find myself needing to look up
>        something in a RFC
>     2. "C-w n" to open a new window, and then basically
>        ":r!SURFRAW_text_browser_args=-dump surfraw rfc 2822" to dump the
>        RFC text in to the new window
>     3. Edit more code until the next mental block, and return to step 2 ;)
> 
>   You may even have nudged me enough to clean it up and post
> a plugin, I guess we'll see if that works out.
> 
>   A different method could be to set a new browser setting in
> ~/.surfraw.conf and use it by quoting the variable name to the -browser
> option.  Definitely could be easier though.

Aha. Before I knew about the awesomeness that is surfraw, I wrote a shell
script to look for things in wikipedia and display it in a nice way on the
console. For this, I used a combination of wget, sed and gawk to fetch the url
and only extract and format the article text in a nice way. Obviously, it was
a nasty hack, and could be done much cleaner. 

Indeed for RFCs it makes just as much sense to have such a capability, just
like for web dictionaries (thus a more modern dict), articles from news sites,
documentation and reference sites etc.

I wonder if this could be implemented as an extra option to the elvi for which
it makes sense. I haven't had much time to look into it yet, though.

-Sumant



More information about the Surfraw-devel mailing list