Commit e208932f authored by Stephen Stafford's avatar Stephen Stafford

Added bbcnews, cddb, freedb and imdb. Integrate Jeff Bailey's patch from

    BSP at debcamp
parent 0b38bdd3
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,8 +4,9 @@ surfraw (1.0.7-2) unstable; urgency=low
* Easy bugs first
- fix type in README (Closes: #154304)
- s/README/README.gz/ in manpage (Closes: #164206)
* Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith.
-- Christian Surchi <csurchi@debian.org> Fri, 1 Aug 2003 09:23:45 +0000
-- Christian Surchi <csurchi@debian.org> Fri, 15 Aug 2003 13:32:00 +0000
surfraw (1.0.7-1) unstable; urgency=low
......
......@@ -5,7 +5,9 @@ bin_SCRIPTS = \
appwatch \
ask \
austlii \
bbcnews \
britannica \
cddb \
cite \
cnn \
currency \
......@@ -17,11 +19,13 @@ bin_SCRIPTS = \
fast \
filesearching \
freebsd \
freedb \
ftpfind \
ftpsearch \
freshmeat \
jake \
google \
imdb \
slinuxdoc \
netbsd \
openbsd \
......
This diff is collapsed.
#!/bin/sh
# $Id$
# elvis: bbcnews -- Search BBC News (news.bbc.co.uk)
# ianb@nessie.mcc.ac.uk 20030209
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_bbcnews_scope world
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
Surfraw search BBC News (news.bbc.co.uk)
Local options:
-scope=world | uk Search world or uk news
Default: $SURFRAW_bbcnews_scope
Environment: SURFRAW_bbcnews_scope
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-scope=*) setopt SURFRAW_bbcnews_scope $optarg ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
# w3_args now contains a list of arguments
if test -z "$w3_args"; then
if [ $SURFRAW_bbcnews_scope = uk ]; then
w3_browse_url "http://news.bbc.co.uk/1/hi.html"
else
w3_browse_url "http://news.bbc.co.uk/2/hi.html"
fi
else
escaped_args=`w3_url_of_arg $w3_args`
if [ $SURFRAW_bbcnews_scope = uk ]; then
w3_browse_url "http://newssearch.bbc.co.uk/cgi-bin/results.pl?scope=newsukfs&tab=news&q=${escaped_args}"
else
w3_browse_url "http://newssearch.bbc.co.uk/cgi-bin/results.pl?scope=newsifs&tab=news&q=${escaped_args}"
fi
fi
#!/bin/sh
# elvis: cddb -- Search for cd track listings in CDDB (www.gracenote.com)
# ianb@nessie.mcc.ac.uk 20030124
. surfraw || exit 1
w3_config_hook () {
# options
defyn SURFRAW_cddb_artists 0
defyn SURFRAW_cddb_albums 0
defyn SURFRAW_cddb_songs 0
defyn SURFRAW_cddb_all 0
# internal
SURFRAW_cddb_default=1
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
Surfraw search CDDB (www.gracenote.com) for cd track listings
Local options:
-artists Search artists
Environment: SURFRAW_cddb_artists
-albums Search albums
Environment: SURFRAW_cddb_songs
-songs Search songs
Environment: SURFRAW_cddb_songs
-all Search all three
Environment: SURFRAW_cddb_all
Default: search artists and albums
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-ar*) setopt SURFRAW_cddb_artists 1 ; setopt SURFRAW_cddb_default 0 ;;
-alb*) setopt SURFRAW_cddb_albums 1 ; setopt SURFRAW_cddb_default 0 ;;
-so*) setopt SURFRAW_cddb_songs 1 ; setopt SURFRAW_cddb_default 0 ;;
-all) setopt SURFRAW_cddb_all 1 ; setopt SURFRAW_cddb_default 0 ;;
*) 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://www.gracenote.com/"
else
escaped_args=`w3_url_of_arg $w3_args`
SURFRAW_cddb_queryopts=''
if [ $SURFRAW_cddb_albums = 1 -o $SURFRAW_cddb_all -eq 1 -o $SURFRAW_cddb_default -eq 1 ];then
SURFRAW_cddb_queryopts="${SURFRAW_cddb_queryopts}f=disc&"
fi
if [ $SURFRAW_cddb_artists = 1 -o $SURFRAW_cddb_all -eq 1 -o $SURFRAW_cddb_default -eq 1 ];then
SURFRAW_cddb_queryopts="${SURFRAW_cddb_queryopts}f=artist&"
fi
if [ $SURFRAW_cddb_songs = 1 -o $SURFRAW_cddb_all -eq 1 ];then
SURFRAW_cddb_queryopts="${SURFRAW_cddb_queryopts}f=track&"
fi
w3_browse_url "http://www.gracenote.com/music/search.html?${SURFRAW_cddb_queryopts}q=${escaped_args}"
fi
#!/bin/sh
# elvis: freedb -- Search for cd track listings in FreeDB (www.freedb.org)
# ianb@nessie.mcc.ac.uk 20030129
# notes at end of script
. surfraw || exit 1
w3_config_hook () {
# options
defyn SURFRAW_freedb_artists 0
defyn SURFRAW_freedb_albums 0
defyn SURFRAW_freedb_songs 0
defyn SURFRAW_freedb_rest 0
defyn SURFRAW_freedb_all 0
defyn SURFRAW_freedb_allfields 0
defyn SURFRAW_freedb_allcats 1
defyn SURFRAW_freedb_bycat 0
def SURFRAW_freedb_cats ""
# internal
SURFRAW_freedb_default=1
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
Surfraw search FreeDB (www.freedb.org) for cd track listings
Local options:
-artists Search artists
Environment: SURFRAW_cddb_artists
-albums Search albums
Environment: SURFRAW_cddb_albums
-songs Search songs
Environment: SURFRAW_cddb_songs
-rest Search the rest of the data
Environment: SURFRAW_cddb_rest
-all Search all fields
Environment: SURFRAW_cddb_all
Default: search artists and albums
-bycat Sort results by category
-cat=CATEGORY Category to search, repeat as needed
Options:
all
blues
classical
country
data
folk
jazz
misc
newage
reggae
rock
soundtrack
Default: all
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-ar*) setopt SURFRAW_freedb_artists 1;setoptyn SURFRAW_freedb_default 0;;
-alb*) setoptyn SURFRAW_freedb_albums 1;setoptyn SURFRAW_freedb_default 0;;
-so*) setoptyn SURFRAW_freedb_songs 1;setoptyn SURFRAW_freedb_default 0;;
-r*) setoptyn SURFRAW_freedb_rest 1;setoptyn SURFRAW_freedb_default 0;;
-all) setoptyn SURFRAW_freedb_all 1;setoptyn SURFRAW_freedb_default 0;;
-bycat) setoptyn SURFRAW_freedb_bycat 1 ;;
-cat*=*) if [ "$optarg" = "all" ]; then
setoptyn SURFRAW_freedb_allcats 1
SURFRAW_freedb_cats=""
else
setoptyn SURFRAW_freedb_allcats 0
SURFRAW_freedb_cats="${SURFRAW_freedb_cats}&cats=$optarg"
fi
;;
*) 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://www.freedb.org/
else
escaped_args=`w3_url_of_arg $w3_args`
SURFRAW_freedb_queryopts=''
if [ $SURFRAW_freedb_albums -eq 1 -o \
$SURFRAW_freedb_all -eq 1 -o \
$SURFRAW_freedb_default -eq 1 ]
then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields=title&"
fi
if [ $SURFRAW_freedb_artists -eq 1 -o \
$SURFRAW_freedb_all -eq 1 -o \
$SURFRAW_freedb_default -eq 1 ]
then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields=artist&"
fi
if [ $SURFRAW_freedb_songs -eq 1 -o \
$SURFRAW_freedb_all -eq 1 ]
then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields=track&"
fi
if [ $SURFRAW_freedb_rest -eq 1 -o \
$SURFRAW_freedb_all -eq 1 ]
then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields=rest&"
fi
if [ $SURFRAW_freedb_bycat = 1 ]; then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}grouping=cats&"
else
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}grouping=none&"
fi
if [ $SURFRAW_freedb_allcats = 1 ]; then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allcats=YES&"
else
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allcats=NO${SURFRAW_freedb_cats}"
fi
if [ $SURFRAW_freedb_all = 1 ]; then
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}&allfields=YES&"
else
SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}&allfields=NO&"
fi
w3_browse_url "http://www.freedb.org/freedb_search.php?${SURFRAW_freedb_queryopts}words=${escaped_args}"
fi
#eg: http://www.freedb.org/freedb_search.php?words=swans&allfields=NO&fields=artist&fields=title&fields=track&fields=rest&allcats=NO&cats=blues&cats=classical&cats=country&cats=data&cats=folk&cats=jazz&cats=misc&cats=newage&cats=reggae&cats=rock&cats=soundtrack&grouping=cats
# minimum: http://www.freedb.org/freedb_search.php?words=swans+are+dead&allfields=YES&allcats=YES&grouping=none
# parameters:
#words=search+words (compulsory)
#allfields=YES | NO (compulsory)
#fields=artist | title | track | rest (can be repeated as often as needed)
#allcats=YES | NO (compulsory)
#cats = blues | classical | country | data | folk | jazz | misc | newage |
# reggae | rock | soundtrack (can be repeated as often as needed)
#grouping=cats | none (compulsory)
#!/bin/sh
# $Id$
# elvis: imdb -- Search the Internet Movie Database (www.imdb.com)
# ianb@nessie.mcc.ac.uk 20030209
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_imdb_category All
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
Surfraw search the Internet Movie Database (www.imdb.com)
Local options:
-category= Category to search
All |
Titles |
MyMovies |
People |
Characters |
Quotes |
Bios |
Plots
Default: $SURFRAW_imdb_category
Environment: SURFRAW_imdb_category
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-category=*) setopt SURFRAW_imdb_category $optarg ;;
*) 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://www.imdb.com/"
else
escaped_args=`w3_url_of_arg $w3_args`
#Avoids people having to quote "My+Movies" on command line
if [ $SURFRAW_imdb_category = MyMovies ]; then
SURFRAW_imdb_category="My+Movies"
fi
w3_browse_url "http://www.imdb.com/Find?select=${SURFRAW_imdb_category}&for=${escaped_args}"
fi
......@@ -4,7 +4,9 @@ amazon -- Search the amazon.com bookstore
appwatch -- Search entries on Appwatch (www.appwatch.com)
ask -- Question the web using Ask Jeeves (www.ask.com)
austlii -- Search Australian Law docs (www.austlii.edu.au)
bbcnews -- Search bbc news site (news.bbc.co.uk)
britannica -- Look up word in Encyclopedia Britannica (www.britannica.com)
cddb -- Search for CD track listings on cddb (www.gracenote.com)
cite -- Search computer science papers (www.researchindex.com)
cnn -- Search on CNN (cnn.com)
currency -- Abuse the Universal Currency Converter (www.xe.net/ucc)
......@@ -16,10 +18,12 @@ excite -- Search on Excite (www.excite.com)
fast -- Search the web using FAST Search (www.alltheweb.com)
filesearching -- Search files on filesearching (www.filesearching.com)
freebsd -- Search FreeBSD related information (www.freebsd.org)
freedb -- Similar to cddb, but search the free equivalent (www.freedb.org)
freshmeat -- Search Freshmeat (www.freshmeat.net)
ftpfind -- Search files on ftpfind (www.ftpfind.com)
ftpsearch -- Search files on ftpsearch (ftpsearch.lycos.com)
google -- Search the web using Google (www.google.com)
imdb -- Search the Internet Movie Database (www.imdb.com)
jake -- Search journal/databases in jake (jake.med.yale.edu)
netbsd -- Search NetBSD related information (www.netbsd.org)
openbsd -- Search OpenBSD related information (www.openbsd.org)
......
......@@ -34,11 +34,11 @@ def SURFRAW_conf $HOME/.surfraw.conf
# graphical browser? defaults to yes for meatminds. text browser users can
# work it out how to change it.
def SURFRAW_graphical yes
def SURFRAW_graphical no
# name/path of text browser executable
# e.g links, lynx, w3m
def SURFRAW_text_browser @sr_text_browser@
def SURFRAW_text_browser lynx
# name/path of browser executable
# e.g mozilla, netscape etc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment