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

Ian Beckwith ianb at erislabs.net
Mon Oct 10 02:24:38 UTC 2011


The following commit has been merged in the master branch:
commit b28abebe657b02d1e2b979cc2e899b6e46c90a79
Author: Kyle Isom <coder at kyleisom.net>
Date:   Wed Sep 28 19:53:49 2011 +0300

    New elvi: wolfram (kyle isom <coder at kyleisom.net>)

diff --git a/AUTHORS b/AUTHORS
index 6453da7..5846c06 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -114,7 +114,7 @@ Jakob <jakob at pipefour.org>
         elvi: pasearch
 
 Kyle Isom <coder at kyleisom.net>
-        elvi: cablesearch, duckduckgo, openports
+        elvi: cablesearch, duckduckgo, openports, wolfram
 	plus fixes.
 
 Jason Ryan <jasonwryan at gmail.com>
diff --git a/ChangeLog b/ChangeLog
index 6b4025f..9703f10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-09 Kyle Isom
+        * New elvi: wolfram - query Wolfram Alpha
+        * Author: Kyle Isom <coder at kyleisom.net>
+        * Added test for wolfram.
+
 2011-08-09  Ian Beckwith  <ianb at erislabs.net>
 
 	* New elvi: priberam - search Portuguese dictionary.
diff --git a/README b/README
index 79e79ea..feca23a 100644
--- a/README
+++ b/README
@@ -261,6 +261,7 @@ webster         -- Look up word in Merriam-Webster's Dictionary (www.m-w.com)
 wetandwild      -- Real time weather information (many sources)
 wikipedia       -- Search the free encyclopedia wikipedia
 woffle          -- Search the web using Woffle (localhost:8080)
+wolfram         -- Ask questions of the computational knowledge engine
 worldwidescience        -- Search for science with www.worldwidescience.org
 yahoo           -- Search Yahoo categories (www.yahoo.com)
 yandex          -- Search the web using Yandex (yandex.ru)
diff --git a/elvi/Makefile.am b/elvi/Makefile.am
index 6182131..f79c20c 100644
--- a/elvi/Makefile.am
+++ b/elvi/Makefile.am
@@ -109,6 +109,7 @@ dist_elvi_SCRIPTS	= \
 		  wetandwild \
 		  wikipedia \
 		  woffle \
+                  wolfram \
 		  worldwidescience \
 		  yahoo \
 		  yandex \
diff --git a/elvi/wolfram b/elvi/wolfram
new file mode 100755
index 0000000..eef6290
--- /dev/null
+++ b/elvi/wolfram
@@ -0,0 +1,41 @@
+#!/bin/sh
+# elvis: wolfram	-- Ask questions of the computational knowledge engine
+# coder at kyleisom.net 20110105
+. surfraw || exit 1
+
+w3_config_hook () {
+    def     SURFRAW_wolfram_results             "$SURFRAW_results"
+    def     SURFRAW_wolfram_base_url            "www.wolframalpha.com/"
+    def     SURFRAW_wolfram_search              search
+    def     SURFRAW_wolfram_params              "input/?i="
+}
+
+w3_usage_hook () {
+    cat <<EOF
+Usage: $w3_argv0 [options] [search words]...
+Description:
+  Surfraw search the web using wolfram (www.wolfram.com)
+Local options:
+    (null) 
+EOF
+    w3_global_usage
+}
+
+w3_parse_option_hook () {
+    opt="$1"
+    optarg="$2"
+    case "$opt" in
+    *) return 1 ;;
+    esac
+    return 0
+}
+
+w3_config
+w3_parse_args "$@"
+# w3_args now contains a list of arguments
+
+SURFRAW_wolfram_base_url="http://${SURFRAW_wolfram_base_url}"
+
+escaped_args=`w3_url_of_arg $w3_args`
+
+w3_browse_url "${SURFRAW_wolfram_base_url}${SURFRAW_wolfram_params}${escaped_args}"
diff --git a/links.IN b/links.IN
index 845d1d5..3409fa7 100644
--- a/links.IN
+++ b/links.IN
@@ -105,6 +105,7 @@ elvi.1sr.gz @mandir@/man1/webster.1sr.gz
 elvi.1sr.gz @mandir@/man1/wetandwild.1sr.gz
 elvi.1sr.gz @mandir@/man1/wikipedia.1sr.gz
 elvi.1sr.gz @mandir@/man1/woffle.1sr.gz
+elvi.1sr.gz @mandir@/man1/wolfram.1sr.gz
 elvi.1sr.gz @mandir@/man1/worldwidescience.1sr.gz
 elvi.1sr.gz @mandir@/man1/yahoo.1sr.gz
 elvi.1sr.gz @mandir@/man1/yandex.1sr.gz
diff --git a/test/urban.test b/test/wolfram.test
similarity index 51%
copy from test/urban.test
copy to test/wolfram.test
index 787ca17..8a4fd80 100644
--- a/test/urban.test
+++ b/test/wolfram.test
@@ -1,2 +1,3 @@
-urban foo
+wolfram foo
 metasyntactic
+

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



More information about the Surfraw-commits mailing list