aboutsummaryrefslogtreecommitdiffstats
path: root/util/hz
diff options
context:
space:
mode:
authorken restivo <ken@restivo.org>2016-01-12 13:19:21 -0800
committerken restivo <ken@restivo.org>2016-01-12 13:19:21 -0800
commitaddf696db8dedb7b8df4a496d3eb1a021f9bcc51 (patch)
tree772869a646e43c177afce2787074eafb98fe40ac /util/hz
parent9327ac0ba73f400dc3f39181cc26f70ad15fb709 (diff)
downloadvolse-hubzilla-addf696db8dedb7b8df4a496d3eb1a021f9bcc51.tar.gz
volse-hubzilla-addf696db8dedb7b8df4a496d3eb1a021f9bcc51.tar.bz2
volse-hubzilla-addf696db8dedb7b8df4a496d3eb1a021f9bcc51.zip
Add very simple, minimalist posting shell script.
Diffstat (limited to 'util/hz')
-rwxr-xr-xutil/hz33
1 files changed, 33 insertions, 0 deletions
diff --git a/util/hz b/util/hz
new file mode 100755
index 000000000..3be684a64
--- /dev/null
+++ b/util/hz
@@ -0,0 +1,33 @@
+#!/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 control-d when done."
+
+}
+
+CUR=`which curl`
+
+[ "$CUR" ] || { echo "curl is not installed or on your path"; usage; exit 1; }
+
+[ "$1" ] && CONF="$1"
+
+[ "$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 control-d:"
+
+(read MSG; curl -ssl -u${USER}:${PASS} --data-urlencode "status=${MSG}" https://${HUB}/api/statuses/update )
+
+