~ubuntu-branches/ubuntu/trusty/surfraw/trusty-proposed

« back to all changes in this revision

Viewing changes to elvi/dmoz

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Smith
  • Date: 2005-04-20 17:00:59 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050420170059-z7j6h1rsqfgfwhmg
Tags: 2.1.0-1
* Ian Beckwith <ianb@nessie.mcc.ac.uk>:
  + New elvi: dmoz, w3html, w3link, w3css, w3rdf.
  + New elvi: rae (by Ruben Pollan <meskio@terra.es>).
  + surfraw.IN:w3_url_escape: escaped `(' and `)'.
  + Fixed elvi (Thanks to Justin B. Rye):
      - sunsolve  (Closes: #289502).
      - altavista (Closes: #289503).
  + deblists: Updated list of debian mailing lists.
  + currency: Now a proper elvis.
  + Added appendix 2 to HACKING on preparing a release.
* Moritz Muehlenhoff <jmm@inutil.org>:
  + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye)
    (Closes: #289498)
  + Fix BBC News search (by Justin B Rye) (Closes: #289499)
  + New elvi by by Justin B Rye (Closes: #290032)
    - cia      Search for CIA documents
    - deblogs  Debian changelogs
    - etym     Search for word origins
    - foldoc   Free online dictionary of computing
  + New cve elvis for CAN assignment searches
  + Rewrite debian/copyright properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
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
 
5
. surfraw || exit 1
 
6
 
 
7
w3_config_hook () {
 
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
 
13
}
 
14
 
 
15
w3_usage_hook () {
 
16
    cat <<EOF
 
17
Usage: $w3_argv0 [options] [URL]
 
18
Description:
 
19
  Search the Open Directory Project web directory (dmoz.org)
 
20
Local options:
 
21
  -cat=CATEGORY                 Search category
 
22
                                Default: all
 
23
                                Values: Arts, Business, Computers, Games, 
 
24
                                        Health, Home, Kids_and_Teens, News,
 
25
                                        Recreation, Reference, Regional, 
 
26
                                        Science, Shopping, Society, Sports, 
 
27
                                        World, Adult
 
28
                                Environment: SURFRAW_dmoz_category
 
29
  -type=SEARCHTYPE              Search type
 
30
                                Default: b
 
31
                                Values: c - Categories Only
 
32
                                        s - Sites only
 
33
                                        b - Both
 
34
                                Environment: SURFRAW_dmoz_searchtype
 
35
  -kids                         Sites for kids.
 
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
 
41
EOF
 
42
    w3_global_usage
 
43
}
 
44
 
 
45
w3_parse_option_hook () {
 
46
    opt="$1"
 
47
    optarg="$2"
 
48
    case "$opt" in
 
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 ;;
 
54
        *) return 1 ;;
 
55
    esac
 
56
    return 0
 
57
}
 
58
 
 
59
w3_config
 
60
w3_parse_args "$@"
 
61
# w3_args now contains a list of arguments
 
62
if test -z "$w3_args"; then
 
63
    w3_browse_url "http://dmoz.org/"
 
64
else
 
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 ]
 
68
        then
 
69
                url="${url}&Kids=1"
 
70
        fi
 
71
        if [ $SURFRAW_dmoz_teens -eq 1 ]
 
72
        then
 
73
                url="${url}&Teens=1"
 
74
        fi
 
75
        if [ $SURFRAW_dmoz_mteens -eq 1 ]
 
76
        then
 
77
                url="${url}&Mteens=1"
 
78
        fi
 
79
 
 
80
        w3_browse_url "${url}"
 
81
fi