2
# $Id: dmoz,v 1.1 2004/09/15 16:56:55 ianb-guest Exp $
3
# elvis: dmoz -- Search the Open Directory Project web directory (dmoz.org)
4
# ianb@nessie.mcc.ac.uk 20040910
8
def SURFRAW_dmoz_category ""
9
def SURFRAW_dmoz_searchtype "b"
10
defyn SURFRAW_dmoz_kids 0
11
defyn SURFRAW_dmoz_teens 0
12
defyn SURFRAW_dmoz_mteens 0
17
Usage: $w3_argv0 [options] [URL]
19
Search the Open Directory Project web directory (dmoz.org)
21
-cat=CATEGORY Search category
23
Values: Arts, Business, Computers, Games,
24
Health, Home, Kids_and_Teens, News,
25
Recreation, Reference, Regional,
26
Science, Shopping, Society, Sports,
28
Environment: SURFRAW_dmoz_category
29
-type=SEARCHTYPE Search type
31
Values: c - Categories Only
34
Environment: SURFRAW_dmoz_searchtype
36
Environment: SURFRAW_dmoz_kids
37
-teens Sites for teens.
38
Environment: SURFRAW_dmoz_teens
39
-mteens Sites for mature teens.
40
Environment: SURFRAW_dmoz_mteens
45
w3_parse_option_hook () {
49
-cat*=*) setopt SURFRAW_dmoz_category "$optarg" ;;
50
-ty*=*) setopt SURFRAW_dmoz_searchtype "$optarg" ;;
51
-ki*) setoptyn SURFRAW_dmoz_kids 1 ;;
52
-te*) setoptyn SURFRAW_dmoz_teens 1 ;;
53
-mt*) setoptyn SURFRAW_dmoz_mteens 1 ;;
61
# w3_args now contains a list of arguments
62
if test -z "$w3_args"; then
63
w3_browse_url "http://dmoz.org/"
65
escaped_args=`w3_url_of_arg $w3_args`
66
url="http://search.dmoz.org/cgi-bin/search?search=${escaped_args}&all=no&cat=${SURFRAW_dmoz_category}&t=${SURFRAW_dmoz_searchtype}"
67
if [ $SURFRAW_dmoz_kids -eq 1 ]
71
if [ $SURFRAW_dmoz_teens -eq 1 ]
75
if [ $SURFRAW_dmoz_mteens -eq 1 ]
80
w3_browse_url "${url}"