[Surfraw-devel] Elvi submit
Sumant Oemrawsingh
soemraws at xs4all.nl
Sat Nov 7 12:05:29 UTC 2009
On Sat, Nov 07, 2009 at 02:17:36AM +0000, Ian Beckwith wrote:
> On Fri, Nov 06, 2009 at 10:59:42PM +0100, Sumant Oemrawsingh wrote:
> > Actually, the site is named l1sp.org, and is a redirect service for several
> > documentation sites regarding common lisp. I just named the elvi after the
> > site.
>
> Oh, right, that's fine.
>
> > Oh, git diff attached.
>
> Thanks! Applied.
>
> Do you have any other patches planned for surfraw in the short term?
> If not, I'll probably put out a release in a couple of weeks, it's
> been a while.
Well, here's a simple youtube elvi. Maybe it makes no sense to have that one
since you really need a graphical browser to use it. So please do with it as
you see fit. I can always put it back in my personal elvi directory.
That's it for now, I think.
Thanks,
Sumant
-------------- next part --------------
diff --git a/elvi/Makefile.am b/elvi/Makefile.am
index e0a0fbf..ef1f3ce 100644
--- a/elvi/Makefile.am
+++ b/elvi/Makefile.am
@@ -92,6 +92,7 @@ dist_elvi_SCRIPTS = \
wikipedia \
woffle \
yahoo \
+ youtube \
yubnub
if OPENSEARCH
diff --git a/elvi/youtube b/elvi/youtube
new file mode 100755
index 0000000..9c3bf57
--- /dev/null
+++ b/elvi/youtube
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# AUTHOR: S.S.R. Oemrawsingh
+#
+# DATE: Sat Nov 07 2009
+#
+# DESC: Elvi to search YouTube
+# elvis: youtube -- Search YouTube (www.youtube.com)
+. surfraw || exit 1
+
+w3_usage_hook () {
+ cat <<EOF
+Usage: $w3_argv0 [options] [search words]...
+Description:
+ Search the common lisp wiki
+EOF
+ w3_global_usage
+}
+
+w3_config
+w3_parse_args "$@"
+if test -z "$w3_args"; then
+ w3_browse_url "http://www.youtube.com/"
+else
+ escaped_args=`w3_url_of_arg $w3_args`
+ w3_browse_url "http://www.youtube.com/results?search_query=${escaped_args}"
+fi
diff --git a/test/Makefile.am b/test/Makefile.am
index 95768e9..1bd4041 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = runtests elviwithouttests README COOKIES W.test \
sunonesearch.test thesaurus.test translate.test urban.test \
w3css.test w3html.test w3link.test w3rdf.test wayback.test \
webster.test wetandwild.test wikipedia.test woffle.test \
- yahoo.test yubnub.test
+ yahoo.test youtube.test yubnub.test
test:
./runtests
diff --git a/test/youtube.test b/test/youtube.test
new file mode 100644
index 0000000..57ce8a5
--- /dev/null
+++ b/test/youtube.test
@@ -0,0 +1,2 @@
+sr youtube simpsons
+Simpsons
More information about the Surfraw-devel
mailing list