annna-get-hashtag-uri - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
annna-get-hashtag-uri (428B)
---
1 #!/bin/sh
2
3 if [ $# -lt 1 ];
4 then
5 printf "usage: %s #tag\n" "$(basename "$0")" >&2
6 exit 1
7 fi
8
9 modbase="/home/annna/bin/modules/"
10 hashtagfile="${modbase}hashtags/hashtags.txt"
11
12 hashtags() {
13 cat ${hashtagfile} 2>/dev/null
14 }
15
16 tagname="$1"
17 tagline="$(printf "%s\n" "$(hashtags)" | grep "^${tagname} ")"
18 taguri="$(printf "%s\n" "${tagline}" | cut -d ' ' -f 2-)"
19 [ -z "$taguri" ] && exit 1
20
21 printf "%s\n" "${taguri}"
22 exit 0
23