[Surfraw-devel] Small patch to yubnub elvi

Nathaniel Heinrichs nheinrichs at gmail.com
Mon Nov 19 05:44:44 UTC 2007


Hi there, w3_parse_args was pre/appending quotes (%22) onto my yubnub
commands, which caused them to redirect to google instead of
executing.
So I threw in a bit of sed to strip them out:

[root at naruzopsycho surfraw]# cat yubnub.diff
*** ./yubnub    2007-11-19 05:42:44.000000000 +0000
--- ./yubnub-patch    2007-11-19 05:42:41.000000000 +0000
***************
*** 18,23 ****
--- 18,24 ----
  if test -z "$w3_args"; then
      w3_browse_url "http://www.yubnub.org/"
  else
+     w3_args=`echo $w3_args | sed 's/^"//; s/"$//;'`
      escaped_args=`w3_url_of_arg $w3_args`
      w3_browse_url "http://yubnub.org/parser/parse?command=${escaped_args}"
  fi


Result:
[root at blah surfraw]# ./yubnub -p "oconv -url
http://weather.yahooapis.com/forecastrss?u=c\&p=JAXX0085 -as json"
http://yubnub.org/parser/parse?command=%22oconv%20-url%20http%3A%2F/weather%2Eyahooapis%2Ecom/forecastrss%3Fu%3Dc%74%26p%3DJAXX0085%20-as%20json%22

[root at blah surfraw]# ./yubnub-patch -p "oconv -url
http://weather.yahooapis.com/forecastrss?u=c\&p=JAXX0085 -as json"
http://yubnub.org/parser/parse?command=oconv%20-url%20http%3A%2F/weather%2Eyahooapis%2Ecom/forecastrss%3Fu%3Dc%74%26p%3DJAXX0085%20-as%20json
[root at blah surfraw]#



More information about the Surfraw-devel mailing list