/usr/lib/surfraw/deli is in surfraw 2.2.8-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #!/bin/sh
# elvis: deli -- Search Delicious bookmarks
# Author: jason ryan • http://jasonwryan.com
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_delicious_results $SURFRAW_results
def SURFRAW_delicious_tags $SURFRAW_tags
def SURFRAW_delicious_user $SURFRAW_user
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search-string]
Description: Search Delicious bookmarks (www.delicious.com)
Local options
-tags=TAG | -t=TAG Refine your search with tags
[Separate multiple tags with "+"]
-user=USER | -u=USER Search a particular user's bookmarks
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-tags=*) setopt SURFRAW_delicious_tags $optarg ;;
-t=*) setopt SURFRAW_delicious_tags $optarg ;;
-u=*) setopt SURFRAW_delicious_user $optarg ;;
-user=*) setopt SURFRAW_delicious_user $optarg ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
# w3_args now contains list of arguments
# standard topic seach
if [ -z "$w3_args" ]; then
w3_browse_url "http://www.delicious.com/search?p=${SURFRAW_delicious_results}&chk=&context=all&fr=del_icio_us&lc=1"
else
escaped_args=$(w3_url_of_arg $w3_args)
# search for topic and tag(s) in a user's bookmarks
if [ -n "${SURFRAW_delicious_user}" -a "${SURFRAW_delicious_tags}" ]; then
w3_browse_url "http://www.delicious.com/search?p=${escaped_args}&chk=&fr=del_icio_us&lc=1&atags=${SURFRAW_delicious_tags}&rtags=&context=userposts%7C${SURFRAW_delicious_user}%7C"
# search for topic in a user's bookmarks
elif [ -n "${SURFRAW_delicious_user}" ]; then
w3_browse_url "http://www.delicious.com/search?p=${escaped_args}&chk=&context=userposts%7C${SURFRAW_delicious_user}&fr=del_icio_us&lc=1"
# search for topic with tag(s)
else
w3_browse_url "http://www.delicious.com/search?p=${escaped_args}&chk=&fr=del_icio_us&lc=1&atags=${SURFRAW_delicious_tags}&rtags=&context=userposts=all"
fi
fi
|