aboutsummaryrefslogtreecommitdiffstats
path: root/util/hz
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-14 18:14:30 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-14 18:14:30 +0100
commit72353bf0446901f1711cba7a2e50dbce9bd06227 (patch)
tree6b73f79bf7386e69e4941ff5a8b4c165830b1652 /util/hz
parent42433c0b4442f1a6b451324fe7f765b1b4c354b8 (diff)
parent9f9fdc1434b7283171f8d843f225228cdb322115 (diff)
downloadvolse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.tar.gz
volse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.tar.bz2
volse-hubzilla-72353bf0446901f1711cba7a2e50dbce9bd06227.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'util/hz')
-rwxr-xr-xutil/hz36
1 files changed, 36 insertions, 0 deletions
diff --git a/util/hz b/util/hz
new file mode 100755
index 000000000..baa5bfb55
--- /dev/null
+++ b/util/hz
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Simple, minimalist command line tool to post status to hubzilla via the API. Requires curl.
+# Put it in your path, and sneeze your statuses to the zot network from your shell.
+
+CONF=${HOME}/.hubzilla
+
+usage () {
+echo "usage: hz [conffile]"
+echo "Create a conf file, either in .hubzilla in your home directory, or supplied as an arg"
+echo " USER=youruserame "
+echo " PASS=yourpass"
+echo " HUB=your.hub.domain.org"
+echo
+echo "Type \"hz\" (with or without a conf file as an arg), then enter your message. Hit ENTER to send."
+
+}
+
+CUR=`which curl`
+
+[ "$CUR" ] || { echo "curl is not installed or on your path"; usage; exit 1; }
+
+[ "$1" ] && CONF="$1"
+
+
+. ${CONF}
+
+[ "$USER" ] || { echo "no USER"; usage; exit 1; }
+[ "$PASS" ] || { echo "no PASS"; usage; exit 1; }
+[ "$HUB" ] || { echo "no HUB"; usage; exit 1; }
+
+echo "enter your message to be posted as $USER @ $HUB, then hit ENTER to send:"
+
+(read MSG; curl -ssl -u${USER}:${PASS} --data-urlencode "status=${MSG}" https://${HUB}/api/statuses/update )
+
+