Introduction
Introduction Statistics Contact Development Disclaimer Help
Simplify hashtag add scripts. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit c2781c22d1d949452881b27dae96a393b5213538
parent ac144faeb9d1e0a49b39693a362cf64f5b857847
Author: Annna Robert-Houdin <[email protected]>
Date: Tue, 14 Oct 2025 22:14:33 +0200
Simplify hashtag add scripts.
Diffstat:
A annna-add-hashtag-git | 49 +++++++++++++++++++++++++++++…
D annna-add-hashtag-mass | 38 -----------------------------…
D annna-add-hashtag-mass-single | 6 ------
D annna-add-hashtag-mass-string | 9 ---------
M phlog-index | 2 --
5 files changed, 49 insertions(+), 55 deletions(-)
---
diff --git a/annna-add-hashtag-git b/annna-add-hashtag-git
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+export PATH="$PATH:/home/annna/bin"
+
+gitdir="/home/annna/bin"
+
+{
+if [ $# -eq 2 ];
+then
+ printf "%s %s\n" "${1} ${2}"
+elif [ $# -eq 1 ];
+then
+ printf "%s\n"
+else
+ cat
+fi
+} \
+| while read -r line;
+do
+ [ "$line" = "meme" ] && continue
+ [ "$line" = "meme2" ] && continue
+ [ -z "$line" ] && continue
+
+ key="$(printf "%s\n" "${line}" | cut -d' ' -f 1)"
+ value="$(printf "%s\n" "${line}" | cut -d' ' -f 2)"
+
+ taguri="$(annna-get-hashtag-uri "${key}")"
+
+ if [ -z "${taguri}" ];
+ then
+ printf "Adding %s = %s\n" "${key}" "${value}"
+
+ annna-add-hashtag "${key}" "${value}" >&2 >/dev/null
+ [ $? -gt 0 ] && continue
+ git -C "$gitdir" commit -a -m "Adding ${key} tag." >&2 >/dev/n…
+ git -C "$gitdir" push >&2 >/dev/null
+
+ taguri="$(annna-get-hashtag-uri "${key}")"
+ if [ -n "${taguri}" ];
+ then
+ annna-say -c '#bitreich-meme' "Enjoy this new meme tag…
+ fi
+ else
+ printf "%s already in db.\n" "${key}"
+ fi
+
+ sleep 2
+done
+
diff --git a/annna-add-hashtag-mass b/annna-add-hashtag-mass
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-export PATH="$PATH:/home/annna/bin"
-
-gitdir="/home/annna/bin"
-
-while read -r line;
-do
- [ "$line" = "meme" ] && continue
- [ "$line" = "meme2" ] && continue
- [ -z "$line" ] && continue
-
- key="$(printf "%s\n" "${line}" | cut -d' ' -f 1)"
- value="$(printf "%s\n" "${line}" | cut -d' ' -f 2)"
-
- taguri="$(annna-get-hashtag-uri "${key}")"
-
- if [ -z "${taguri}" ];
- then
- printf "Adding %s = %s\n" "${key}" "${value}"
-
- annna-add-hashtag "${key}" "${value}" >&2 >/dev/null
- [ $? -gt 0 ] && continue
- git -C "$gitdir" commit -a -m "Adding ${key} tag." >&2 >/dev/n…
- git -C "$gitdir" push >&2 >/dev/null
-
- taguri="$(annna-get-hashtag-uri "${key}")"
- if [ -n "${taguri}" ];
- then
- annna-say -c '#bitreich-meme' "Enjoy this new meme tag…
- fi
- else
- printf "%s already in db.\n" "${key}"
- fi
-
- sleep 2
-done
-
diff --git a/annna-add-hashtag-mass-single b/annna-add-hashtag-mass-single
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-export PATH="$PATH:/home/annna/bin"
-
-printf "%s %s\n" "${1}" "${2}" | annna-add-hashtag-mass
-
diff --git a/annna-add-hashtag-mass-string b/annna-add-hashtag-mass-string
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-export PATH="$PATH:/home/annna/bin"
-
-cd $HOME/bin
-key="$(printf "%s\n" "${1}" | cut -d' ' -f 1)"
-value="$(printf "%s\n" "${1}" | cut -d' ' -f 2-)"
-printf "%s %s\n" "${key}" "${value}" | annna-add-hashtag-mass
-
diff --git a/phlog-index b/phlog-index
@@ -1,7 +1,5 @@
#!/bin/sh
-set -x
-
export PATH="$PATH:/home/annna/bin"
doforce=0
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.