[Surfraw-devel] surfraw 2.2.2 google elvi

John Briggs john_briggs at telstra.com
Wed Jul 9 02:44:47 UTC 2008


Hi Guys.
Haven't played with this yet,
but getting this going on my Sun SPARC,
I had to modify the google elvi to get it to work.

== is normally used to compare numerics, not strings
Not quoting SURFRAW_google_lucky is also looking for problems.

And since Sun's AWK is rooted,
it would be nice if you could automagically use nawk too.
Thanks.
-J


*** /usr/local/lib/surfraw/google       Wed Jul  9 12:04:13 2008
--- elvi/google Mon Mar 24 11:07:17 2008
***************
*** 53,59 ****
  # w3_args now contains a list of arguments

  # Use SURFRAW_lang if present and the country has not been changed
! if test -n "$SURFRAW_lang" -a "$SURFRAW_google_country" = "us"; then
      SURFRAW_google_country=$SURFRAW_lang;
  fi

--- 53,59 ----
  # w3_args now contains a list of arguments

  # Use SURFRAW_lang if present and the country has not been changed
! if test -n "$SURFRAW_lang" -a "$SURFRAW_google_country" == "us"; then
      SURFRAW_google_country=$SURFRAW_lang;
  fi

***************
*** 68,74 ****
      w3_browse_url "http://www.google.${domain}/"
  else
      escaped_args=`w3_url_of_arg $w3_args`
!       if [ "$SURFRAW_google_lucky" = 1 ]; then
                button=`w3_url_escape "I'm Feeling Lucky"`
                w3_browse_url 
"http://www.google.${domain}/${SURFRAW_google_search}?q=${escaped_args}&btnI=$button&num=${SURFRAW_google_results}"
        else
--- 68,74 ----
      w3_browse_url "http://www.google.${domain}/"
  else
      escaped_args=`w3_url_of_arg $w3_args`
!       if [ $SURFRAW_google_lucky = 1 ]; then
                button=`w3_url_escape "I'm Feeling Lucky"`
                w3_browse_url 
"http://www.google.${domain}/${SURFRAW_google_search}?q=${escaped_args}&btnI=$button&num=${SURFRAW_google_results}"
        else





More information about the Surfraw-devel mailing list