[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-139-g34aa813
Ian Beckwith
ianb at erislabs.net
Wed Dec 8 06:18:12 UTC 2010
The following commit has been merged in the master branch:
commit 2bfe96b99d62989d961b535937fffb912a02c84b
Author: Ian Beckwith <ianb at erislabs.net>
Date: Wed Dec 8 05:46:28 2010 +0000
arxiv: apply patch from MT <mt_void at warpmail.net>
diff --git a/ChangeLog b/ChangeLog
index 272e00a..6cb544f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-08 Ian Beckwith <ianb at erislabs.net>
+
+ * arxiv: Thanks to MT <mt_void at warpmail.net> for patch that fixes:
+ 1. Search queries with more than two terms would fail, e.g.
+ 'supermassive black hole'.
+ 2. Full text search was broken, it works now.
+ 3. Enhancement: quoting the query now does an exact string match.
+
2010-10-29 Ian Beckwith <ianb at erislabs.net>
* wayback: advanced search is broken, rip out all
diff --git a/elvi/arxiv b/elvi/arxiv
index 5bf40d8..855ba5d 100755
--- a/elvi/arxiv
+++ b/elvi/arxiv
@@ -53,7 +53,7 @@ w3_parse_option_hook () {
w3_config
# Parse search terms
-SURFRAW_quote_ifs=0
+SURFRAW_escape_url_args=no
w3_parse_args "$@"
@@ -63,13 +63,18 @@ cnt=0
if [ ! -z "$w3_args" ]; then
case $SURFRAW_arxiv_scope in
all | title | abstract)
- for w in $w3_args ; do
- terms=$terms"+"`w3_url_of_arg $w`
- cnt=$((cnt + 1))
- done
- if [ $cnt -gt 1 ]; then
- terms="+AND"$terms
+ if [ `w3_url_of_arg $w3_args | cut -c1` = \" ]; then
+ terms="+EXACT+"`echo $w3_args | sed -e 's/ /_/g'`
+ else
+ for w in $w3_args ; do
+ terms="+"`w3_url_of_arg $w`$terms
+ cnt=$((cnt + 1))
+ if [ $cnt -gt 1 ]; then
+ terms="+AND"$terms
+ fi
+ done
fi
+ terms=`echo $terms | sed -e 's/"//g'`
;;
author)
# Names without commas need to be reversed
@@ -94,14 +99,7 @@ if [ ! -z "$w3_args" ]; then
fi
;;
fulltext)
- # Need to remove leading/trailing spaces and quotes
- for w in $w3_args ; do
- if [ -z $terms ]; then
- terms=`w3_url_of_arg $w`
- else
- terms="$terms "`w3_url_of_arg $w`
- fi
- done
+ terms=`w3_url_escape $w3_args`
;;
*)
return 1 ;;
--
surfraw - a fast unix command line interface to WWW
More information about the Surfraw-commits
mailing list