[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-242-g846275f

Kyle Isom coder at kyleisom.net
Tue Oct 16 21:19:07 UTC 2012


The following commit has been merged in the master branch:
commit d4d646180917b392bbf33894913ca61018229a67
Author: Kyle Isom <coder at kyleisom.net>
Date:   Tue Oct 16 14:58:10 2012 -0600

    Update AUR, rae, and yandex elvi.

diff --git a/elvi/aur b/elvi/aur
index 77a2ee3..b51c4c9 100755
--- a/elvi/aur
+++ b/elvi/aur
@@ -14,6 +14,7 @@ w3_config_hook () {
     def   SURFRAW_aur_order    "a"
     def   SURFRAW_aur_language en
     defyn SURFRAW_aur_outdated 0
+    def   SURFRAW_aur_protocol "https"
     def   SURFRAW_aur_results  "$SURFRAW_results"
     def   SURFRAW_aur_search   name
     def   SURFRAW_aur_sort     name
@@ -32,6 +33,9 @@ Local options
   -language                     Search in your your language
                                 See aur.archlinux.org for available languages
                                 Default: en
+  -no-https                     Connect using HTTP, rather than HTTPS.
+                                This disables logging in.
+                                Default: use $SURFRAW_aur_protocol
   -order=ascending|descending   Organize in ascending or descending order
                                 Default: ascending
   -orphans                      Search orphaned packages
@@ -62,6 +66,7 @@ w3_parse_option_hook () {
     case "$opt" in
         -category=*) setopt   SURFRAW_aur_category "$optarg" ;;
         -language=*) setopt   SURFRAW_aur_language "$optarg" ;;
+        -no-https)   setopt   SURFRAW_aur_protocol "http" ;;
         -orphans*)   setopt   SURFRAW_aur_action   "Orphans=Orphans" ;;
         -order=d*)   setopt   SURFRAW_aur_order    d ;;
         -order=*)    setopt   SURFRAW_aur_order    a ;;
@@ -130,12 +135,12 @@ esac
 
 # w3_args now contains a list of arguments
 if test -z "$w3_args" && test "$SURFRAW_aur_action" = "Search=Go"; then
-    w3_browse_url "http://aur.archlinux.org/packages.php?setlang=${aur_lang}"
+    w3_browse_url "${SURFRAW_aur_protocol}://aur.archlinux.org/packages.php?setlang=${aur_lang}"
 else
     escaped_args=`w3_url_of_arg $w3_args`
     if [ "$SURFRAW_aur_outdated" = 1 ]; then
-        w3_browse_url "http://aur.archlinux.org/packages.php?O=0&L=0&detail=1&C=${aur_category}&K=${escaped_args}&SeB=${aur_search_by}&SB=${aur_sort_by}&SO=${SURFRAW_aur_order}&PP=${SURFRAW_aur_results}&do_${SURFRAW_aur_action}&outdated=on&setlang=${aur_lang}"
+        w3_browse_url "${SURFRAW_aur_protocol}://aur.archlinux.org/packages.php?O=0&L=0&detail=1&C=${aur_category}&K=${escaped_args}&SeB=${aur_search_by}&SB=${aur_sort_by}&SO=${SURFRAW_aur_order}&PP=${SURFRAW_aur_results}&do_${SURFRAW_aur_action}&outdated=on&setlang=${aur_lang}"
     else
-        w3_browse_url "http://aur.archlinux.org/packages.php?O=0&L=0&detail=1&C=${aur_category}&K=${escaped_args}&SeB=${aur_search_by}&SB=${aur_sort_by}&SO=${SURFRAW_aur_order}&PP=${SURFRAW_aur_results}&do_${SURFRAW_aur_action}&setlang=${aur_lang}"
+        w3_browse_url "${SURFRAW_aur_protocol}://aur.archlinux.org/packages.php?O=0&L=0&detail=1&C=${aur_category}&K=${escaped_args}&SeB=${aur_search_by}&SB=${aur_sort_by}&SO=${SURFRAW_aur_order}&PP=${SURFRAW_aur_results}&do_${SURFRAW_aur_action}&setlang=${aur_lang}"
     fi
 fi
diff --git a/elvi/rae b/elvi/rae
index 54f0161..be2ffbf 100755
--- a/elvi/rae
+++ b/elvi/rae
@@ -39,8 +39,8 @@ w3_config
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 if null "$w3_args"; then
-    w3_browse_url "http://buscon.rae.es/diccionario/drae.htm"
+    w3_browse_url "http://www.rae.es/drae/"
 else
     escaped_args=`w3_url_of_arg $w3_args`
-    w3_browse_url "http://buscon.rae.es/draeI/SrvltGUIBusUsual?TIPO_HTML=2&LEMA=${escaped_args}&&TIPO_BUS=${SURFRAW_rae_tipo}"
+    w3_browse_url "http://www.rae.es/drae/srv/search?type=3D${SURFRAW_rae_tipo}=&val=${escaped_args}"
 fi
diff --git a/elvi/yandex b/elvi/yandex
index f345691..9d5ba3c 100755
--- a/elvi/yandex
+++ b/elvi/yandex
@@ -33,7 +33,7 @@ w3_parse_option_hook () {
        *)      return 1
     esac
     setopt SURFRAW_yandex_domain "${opt:+${opt#-}.}"
-    [ -n $search ] && setopt SURFRAW_yandex_search "${search}text"
+    [[ -n $search ]] && setopt SURFRAW_yandex_search "${search}text"
     return 0
 }
 

-- 
surfraw -  a fast unix command line interface to WWW



More information about the Surfraw-commits mailing list