[Surfraw-commits] [surfraw] 01/01: P-R elvi cleanup

jason ryan jasonwryan-guest at moszumanska.debian.org
Mon Mar 13 00:54:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

jasonwryan-guest pushed a commit to branch kyle/https-elvi
in repository surfraw.

commit 06ed55421120782a79d0992fe4e92d490b7e9a5f
Author: Jason Ryan <jasonwryan at gmail.com>
Date:   Mon Mar 13 13:54:17 2017 +1300

    P-R elvi cleanup
---
 elvi/pasearch       | 78 -----------------------------------------
 elvi/pgdoc          |  2 +-
 elvi/phpdoc         |  2 +-
 elvi/pin            |  2 +-
 elvi/piratebay      | 11 +++---
 elvi/priberam       |  4 +--
 elvi/pubmed         |  4 +--
 elvi/rae            |  4 +--
 elvi/rfc            |  8 ++---
 elvi/rhyme          | 61 ---------------------------------
 elvi/rpmsearch      | 99 -----------------------------------------------------
 test/pasearch.test  |  8 -----
 test/rhyme.test     |  2 --
 test/rpmsearch.test |  2 --
 14 files changed, 19 insertions(+), 268 deletions(-)

diff --git a/elvi/pasearch b/elvi/pasearch
deleted file mode 100755
index 6417c56..0000000
--- a/elvi/pasearch
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-#
-# AUTHOR: jakob
-#
-# DATE: 2010.12.04
-#
-# DESC: Elvis to search the unofficial Penny Arcade archives
-# elvis: pasearch	-- Search the unofficial Penny Arcade archives (pipefour.org/pa)
-. surfraw || exit 1
-
-w3_usage_hook () {
-	cat <<EOF
-Usage: $w3_argv0 [options] [search words]...
-Description:
-  Search the unofficial Penny Arcade archives (pipefour.org/pa)
-Local options:
-  -t/-T				Enable/disable searching title field
-				Default: yes
-				Environment: SURFRAW_pasearch_search_title
-  -b/-B				Enable/disable searching body field
-				Default: yes
-				Environment: SURFRAW_pasearch_search_body
-  -n/-N				Enable/disable searching notes field
-				Default: yes
-				Environment: SURFRAW_pasearch_search_notes
-  -p/-P				Enable/disable showing preview thumbnails
-				Default: yes
-				Environment: SURFRAW_pasearch_show_previews
-EOF
-	w3_global_usage
-}
-
-w3_config_hook () {
-	defyn SURFRAW_pasearch_search_title  1
-	defyn SURFRAW_pasearch_search_body   1
-	defyn SURFRAW_pasearch_search_notes  1
-	defyn SURFRAW_pasearch_show_previews 1
-}
-
-w3_parse_option_hook () {
-	opt="$1"
-	optarg="$2"
-	case "$opt" in
-		-t) setoptyn SURFRAW_pasearch_search_title  1 ;;
-		-T) setoptyn SURFRAW_pasearch_search_title  0 ;;
-		-b) setoptyn SURFRAW_pasearch_search_body   1 ;;
-		-B) setoptyn SURFRAW_pasearch_search_body   0 ;;
-		-n) setoptyn SURFRAW_pasearch_search_notes  1 ;;
-		-N) setoptyn SURFRAW_pasearch_search_notes  0 ;;
-		-p) setoptyn SURFRAW_pasearch_show_previews 1 ;;
-		-P) setoptyn SURFRAW_pasearch_show_previews 0 ;;
-		*) return 1 ;;
-	esac
-	return 0
-}
-
-w3_config
-w3_parse_args "$@"
-
-# Make sure they have at least one field enabled
-ifno SURFRAW_pasearch_search_title &&
-ifno SURFRAW_pasearch_search_body &&
-ifno SURFRAW_pasearch_search_notes &&
-	err You can\'t search 0 fields.
-
-if test -z "$w3_args"; then
-	w3_browse_url "http://pipefour.org/pa/"
-else
-	escaped_args=`w3_url_of_arg $w3_args`
-	ifyes SURFRAW_pasearch_search_title && fields=${fields}'&search[]=title'
-	ifyes SURFRAW_pasearch_search_body && fields=${fields}'&search[]=body'
-	ifyes SURFRAW_pasearch_search_notes && fields=${fields}'&search[]=notes'
-
-	thumbs="off"
-	ifyes SURFRAW_pasearch_show_previews && thumbs=on
-
-	w3_browse_url "http://pipefour.org/pa/search.php?thumbs=${thumbs}&${fields}&q=${escaped_args}"
-fi
diff --git a/elvi/pgdoc b/elvi/pgdoc
index 42834d4..c46d633 100755
--- a/elvi/pgdoc
+++ b/elvi/pgdoc
@@ -58,7 +58,7 @@ then
             inurl="${inurl}static/"
         fi
     fi
-    w3_browse_url "http://www.postgresql.org${inurl}"
+    w3_browse_url "https://www.postgresql.org${inurl}"
 
 else
 
diff --git a/elvi/phpdoc b/elvi/phpdoc
index fc46e87..5db3cd4 100644
--- a/elvi/phpdoc
+++ b/elvi/phpdoc
@@ -88,7 +88,7 @@ w3_config
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 
-url="http://php.net/"
+url="https://php.net/"
 
 case "$SURFRAW_php_language" in
     en) lang="en"    ;;
diff --git a/elvi/pin b/elvi/pin
index 79b9a58..8978180 100755
--- a/elvi/pin
+++ b/elvi/pin
@@ -1,5 +1,5 @@
 #!/bin/sh
-# elvis: pin		-- Search Pinboard bookmarks (http://pinboard.in)
+# elvis: pin		-- Search Pinboard bookmarks (https://pinboard.in)
 # author: jason ryan • http://jasonwryan.com
 
 . surfraw || exit 1
diff --git a/elvi/piratebay b/elvi/piratebay
index 0afd76a..0777cbe 100755
--- a/elvi/piratebay
+++ b/elvi/piratebay
@@ -1,5 +1,5 @@
 #!/bin/sh
-# elvis: piratebay	-- Search The Pirate Bay (http://thepiratebay.org)
+# elvis: piratebay		-- Search The Pirate Bay (https://thepiratebay.org)
 
 . surfraw || exit 1
 
@@ -71,17 +71,18 @@ escaped_args=$(w3_url_of_arg $w3_args)
 
 # just browsing category
 if [ -n "$SURFRAW_bay_categories" ] && [ -z "$w3_args" ]; then
-	w3_browse_url "http://thepiratebay.org/browse/${category}"
+	w3_browse_url "https://thepiratebay.org/browse/${category}"
 
 	# searching category for string
 	elif [ -n "$SURFRAW_bay_categories" ] && [ -n "$w3_args" ]; then
-		w3_browse_url "http://thepiratebay.org/search/${escaped_args}/0/99/${category}"
+		w3_browse_url "https://thepiratebay.org/search/${escaped_args}/0/99/${category}"
 	
 	# no arguments passed
 	elif [ -z "$w3_args" ]; then
-    	w3_browse_url "http://thepiratebay.org/"
+    	w3_browse_url "https://thepiratebay.org/"
 	
 # no category specified
-else w3_browse_url "http://thepiratebay.org/search/${escaped_args}"
+else w3_browse_url "https://thepiratebay.org/search/${escaped_args}"
 		
 fi
+
diff --git a/elvi/priberam b/elvi/priberam
index 05daddc..52f6d41 100755
--- a/elvi/priberam
+++ b/elvi/priberam
@@ -22,8 +22,8 @@ SURFRAW_quote_ifs=0
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 if test -z "$w3_args"; then
-    w3_browse_url "http://www.priberam.pt/dlpo/"
+    w3_browse_url "https://www.priberam.pt/dlpo/"
 else
     escaped_args=`w3_url_of_arg $w3_args`
-    w3_browse_url "http://www.priberam.pt/dlpo/default.aspx?pal=${escaped_args}"
+    w3_browse_url "https://www.priberam.pt/dlpo/default.aspx?pal=${escaped_args}"
 fi
diff --git a/elvi/pubmed b/elvi/pubmed
index 9df5936..5ba82a3 100755
--- a/elvi/pubmed
+++ b/elvi/pubmed
@@ -41,8 +41,8 @@ w3_config
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 if test -z "$w3_args"; then
-    w3_browse_url "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi"
+    w3_browse_url "https://www.ncbi.nlm.nih.gov/entrez/query.fcgi"
 else
     escaped_args=`w3_url_of_arg $w3_args`
-    w3_browse_url "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?SUBMIT=y&term=${escaped_args}&db=${SURFRAW_pubmed_database}&orig_db=PubMed&cmd="
+    w3_browse_url "https://www.ncbi.nlm.nih.gov/entrez/query.fcgi?SUBMIT=y&term=${escaped_args}&db=${SURFRAW_pubmed_database}&orig_db=PubMed&cmd="
 fi
diff --git a/elvi/rae b/elvi/rae
index 08d089d..6109637 100755
--- a/elvi/rae
+++ b/elvi/rae
@@ -19,8 +19,8 @@ w3_config
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 if null "$w3_args"; then
-    w3_browse_url "http://lema.rae.es/drae/"
+    w3_browse_url "https://lema.rae.es/drae/"
 else
     escaped_args=`w3_url_of_arg $w3_args`
-    w3_browse_url "http://lema.rae.es/drae/?val=${escaped_args}"
+    w3_browse_url "https://lema.rae.es/drae/?val=${escaped_args}"
 fi
diff --git a/elvi/rfc b/elvi/rfc
index b643516..f93dd71 100755
--- a/elvi/rfc
+++ b/elvi/rfc
@@ -79,7 +79,7 @@ w3_config
 w3_parse_args "$@"
 # w3_args now contains a list of arguments
 if test -z "$w3_args"; then
-    w3_browse_url "http://www.rfc-editor.org/rfcsearch.html"
+    w3_browse_url "https://www.rfc-editor.org/rfcsearch.html"
 else
     escaped_args=`w3_url_of_arg $w3_args`
 
@@ -115,9 +115,9 @@ else
             then
                 url="ftp://ftp.rfc-editor.org/in-notes${subdir}/${fileprefix}${escaped_args}.txt"
             elif [ $fileprefix = rfc ] || [ $fileprefix = bcp ]; then
-		url="http://tools.ietf.org/html/${fileprefix}${escaped_args}"
+		url="https://tools.ietf.org/html/${fileprefix}${escaped_args}"
 	    else
-                url="http://www.rfc-editor.org/rfc${subdir}/${fileprefix}${escaped_args}.txt"
+                url="https://www.rfc-editor.org/rfc${subdir}/${fileprefix}${escaped_args}.txt"
             fi
         else # godless PDFs
             case "$SURFRAW_rfc_search" in
@@ -133,7 +133,7 @@ else
     else
 
         # not direct to rfc, construct url from options
-        url="http://www.rfc-editor.org/cgi-bin/rfcsearch.pl?searchwords=${escaped_args}"
+        url="https://www.rfc-editor.org/cgi-bin/rfcsearch.pl?searchwords=${escaped_args}"
 
         if [ $isnum -eq 1 -a $searchset -eq 0 ]
         then
diff --git a/elvi/rhyme b/elvi/rhyme
deleted file mode 100755
index beaa6eb..0000000
--- a/elvi/rhyme
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-# $Id$
-# elvis: rhyme		-- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com)
-. surfraw || exit 1
-
-w3_config_hook () {
-def   SURFRAW_rhyme_method perfect
-}
-
-w3_usage_hook () {
-    cat <<EOF
-Usage: $w3_argv0 [options] [search words]...
-Description:
-  Surfraw search for rhymes and other word correlations using
-  Lycos Rhyme (rhyme.lycos.com)
-Example:
-  \$ rhyme Julian
-  \$ rhyme -method=rel surfer
-Results:
-  Hurclean St. Julien.
-  surfboarder, bather, natator, swimmer
-Local options:
-  -method=                      Type of word correlation to search for
-          prefect       |       Perfect rhyme
-	  syn		|	Synonyms
-	  hom		|	Homophones
-	  cons		|	Consonsant rhymes only
-	  rel		|	Semantically related words
-	  sub		|	Phrases
-	  spell		|	Similar spellings
-	  pic		|	Pictures
-	  shake		|	Match with Shakespeare archives
-	  def			Find wordnet definition
-                                Default: $SURFRAW_rhyme_method
-				Environment: SURFRAW_rhyme_method
-EOF
-    w3_global_usage
-}
-
-w3_parse_option_hook () {
-    opt="$1"
-    optarg="$2"
-    case "$opt" in
-	-method=*) setopt   SURFRAW_rhyme_method $optarg	;;
-	*) return 1 ;;
-    esac
-    return 0
-}
-
-w3_config
-# disable requoting, doesn't work with this elvi.
-SURFRAW_quote_ifs=0
-w3_parse_args "$@"
-# w3_args now contains a list of arguments
-if test -z "$w3_args"; then
-    w3_browse_url "http://www.rhymezone.com/"
- else
-    escaped_args=`w3_url_of_arg $w3_args`
-    w3_browse_url "http://www.rhymezone.com/r/rhyme.cgi?Word=${escaped_args}&typeofrhyme=${SURFRAW_rhyme_method}&org1=syl&org2=l"
-
-fi
diff --git a/elvi/rpmsearch b/elvi/rpmsearch
deleted file mode 100755
index df34eb2..0000000
--- a/elvi/rpmsearch
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-# elvis: rpmsearch	-- Search for RPMs in various distros
-# ianb at erislabs.net 20091112
-. surfraw || exit 1
-
-w3_config_hook () {
-    def   SURFRAW_rpmsearch_distro  all
-    def   SURFRAW_rpmsearch_deptype ""
-    def   SURFRAW_rpmsearch_by      fuzzyname
-}
-
-w3_usage_hook () {
-    cat <<EOF
-Usage: $w3_argv0 [options] [search words]...
-Description:
-  Search for RPMs in various distros
-Local options:
-  -search=TYPE                  Search by TYPE
-          fuzzyname       |      Fuzzy name match
-          rpmname         |      RPM name
-          dep             |      Dependency Match
-          file            |      Search by File
-                                Default: $SURFRAW_rpmsearch_by
-                                Environment: SURFRAW_rpmsearch_by
-  -dep=                         Dependency match type (implies -search=dep)
-          provides        |      Provides
-          requires        |      Requires
-          conflict        |      Conflict
-          obsoletes       |      Obsoletes
-          trigger         |      Trigger
-          suggest         |      Suggest
-          enhanced        |      Enhanced
-                                Default: $SURFRAW_rpmsearch_by
-                                Environment: SURFRAW_rpmsearch_by
-  -distro=NAME                  Search in distribution NAME
-          all             |      All (default)
-          Altlinux        |      Altlinux
-          Arklinux        |      Arklinux
-          Caosity         |      Caosity
-          CentOS          |      CentOS
-          Fedora          |      Fedora
-          Mageia          |      Mageia
-          Mandriva        |      Mandriva
-          Momonga         |      Momonga
-          OpenSuse        |      OpenSuse
-          PLD             |      PLD
-          ScientificLinux |      Scientific Linux
-          UnityLinux      |      Unity Linux
-                                Default: $SURFRAW_rpmsearch_distro
-                                Environment: SURFRAW_rpmsearch_distro
-EOF
-    w3_global_usage
-}
-
-w3_parse_option_hook () {
-    opt="$1"
-    optarg="$2"
-    case "$opt" in
-    -dist*=*)   setopt   SURFRAW_rpmsearch_distro  "$optarg" ;;
-    -de*=*)     case "$optarg" in
-		    [Pp]*) setopt SURFRAW_rpmsearch_deptype "P";;
-		    [Rr]*) setopt SURFRAW_rpmsearch_deptype "R";;
-		    [Cc]*) setopt SURFRAW_rpmsearch_deptype "C";;
-		    [Oo]*) setopt SURFRAW_rpmsearch_deptype "O";;
-		    [Tt]*) setopt SURFRAW_rpmsearch_deptype "T";;
-		    [Ss]*) setopt SURFRAW_rpmsearch_deptype "S";;
-		    [Ee]*) setopt SURFRAW_rpmsearch_deptype "E";;
-		    *)     err "unknown dep type";;
-		esac
-		setopt SURFRAW_rpmsearch_by bydep ;;
-    -sear*=*)   case "$optarg" in
-                    fu*)      setopt SURFRAW_rpmsearch_by fuzzyname;;
-		    byn*|r*)  setopt SURFRAW_rpmsearch_by byname;;
-		    bydep|d*) setopt SURFRAW_rpmsearch_by bydep;;
-		    byf|fi*)  setopt SURFRAW_rpmsearch_by byfile;;
-		    *)        err "unknown search type" ;;
-		esac ;;
-
-    *) return 1 ;;
-    esac
-    return 0
-}
-
-w3_config
-w3_parse_args "$@"
-# w3_args now contains a list of arguments
-
-if test -z "$w3_args"; then
-    w3_browse_url "http://sophie.zarb.org/search"
-else
-    escaped_args=`w3_url_of_arg $w3_args`
-
-    if [ "$SURFRAW_rpmsearch_distro" = all ]; then
-	SURFRAW_rpmsearch_distro=""
-    elif [ "$SURFRAW_rpmsearch_distro" = ScientificLinux ]; then
-	SURFRAW_rpmsearch_distro="Scientific+Linux"
-    fi
-    w3_browse_url "http://sophie.zarb.org/search?distribution=${SURFRAW_rpmsearch_distro}&search=${escaped_args}&type=${SURFRAW_rpmsearch_by}&deptype=${SURFRAW_rpmsearch_deptype}"
-fi
diff --git a/test/pasearch.test b/test/pasearch.test
deleted file mode 100644
index 8867c27..0000000
--- a/test/pasearch.test
+++ /dev/null
@@ -1,8 +0,0 @@
-pasearch
-Pipe Four
-pasearch gabe
-Pipe Four
-pasearch wax pig
-Virtually Unlimited Potential
-pasearch -p gabe
-\<th\> Preview \<\/th\>
diff --git a/test/rhyme.test b/test/rhyme.test
deleted file mode 100644
index b3c046e..0000000
--- a/test/rhyme.test
+++ /dev/null
@@ -1,2 +0,0 @@
-rhyme foo
-outrigger.*canoe
diff --git a/test/rpmsearch.test b/test/rpmsearch.test
deleted file mode 100644
index a87723b..0000000
--- a/test/rpmsearch.test
+++ /dev/null
@@ -1,2 +0,0 @@
-rpmsearch surfraw
-surfraw-.*\.noarch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/surfraw/surfraw.git



More information about the Surfraw-commits mailing list