aboutsummaryrefslogtreecommitdiffstats
path: root/util/hz
diff options
context:
space:
mode:
authorPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:20:58 +0200
committerPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:20:58 +0200
commit45a854762b451dafb882bc56efce054b64420627 (patch)
tree958fcd22f04546f40b6ac68bb58cfe1a1b1fb7f6 /util/hz
parent1806da0851dd5cf5978b19d12783ae3101a11257 (diff)
parenta29c0371f1f3cceb9a9af3a62e5ed67886869c40 (diff)
downloadvolse-hubzilla-45a854762b451dafb882bc56efce054b64420627.tar.gz
volse-hubzilla-45a854762b451dafb882bc56efce054b64420627.tar.bz2
volse-hubzilla-45a854762b451dafb882bc56efce054b64420627.zip
Resolved conflict in view/it/hstrings.php
Diffstat (limited to 'util/hz')
-rwxr-xr-xutil/hz38
1 files changed, 38 insertions, 0 deletions
diff --git a/util/hz b/util/hz
new file mode 100755
index 000000000..cb6ccf419
--- /dev/null
+++ b/util/hz
@@ -0,0 +1,38 @@
+#!/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. Use ctrl-D 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 Ctrl-D to send."
+
+MSG=$(cat)
+
+curl -ssl -u${USER}:${PASS} --data-urlencode "status=${MSG}" https://${HUB}/api/statuses/update
+
+