[Surfraw-devel] Dump mode
Ian Beckwith
ianb at erislabs.net
Thu Oct 23 22:15:05 UTC 2008
Hi,
On Thu, Oct 09, 2008 at 10:17:48AM -0700, Fracking Honey wrote:
> Hi all. I'd like to see a dump mode for surfraw, which would open
> elinks, lynx, links or whatever with the -dump option, so you could
> pipe the output to other programs. I was going to write a wrapper
> script that would do this, but it looks to me like there is no way
> to pass any parameters to the browser that is called by surfraw -
> please correct me if I'm wrong about this!
You can use the environment variables SURFRAW_browser_args or
SURFRAW_text_browser_args for this.
A quick wrapper script:
#!/bin/sh
SURFRAW_conf=/dev/null SURFRAW_browser="lynx" SURFRAW_browser_args="-dump" surfraw "$@"
This also sets SURFRAW_conf to avoid ~/.surfraw.conf overriding the environment
If this is not enough, you can use SURFRAW_browser=echo to extract the url
and then fetch the page yourself. See test/runtests in the surfraw distribution
for an example of this.
Ian.
--
Ian Beckwith - ianb at erislabs.net - http://erislabs.net/ianb/
GPG fingerprint: AF6C C0F1 1E74 424B BCD5 4814 40EC C154 A8BA C1EA
Listening to: Tom Waits - Swordfishtrombones - Gin Soaked Boy
More information about the Surfraw-devel
mailing list