summaryrefslogtreecommitdiff
path: root/doc/snac.1
diff options
context:
space:
mode:
authorpoesty <poesty@noreply.codeberg.org>2023-05-07 07:27:24 +0000
committerpoesty <poesty@noreply.codeberg.org>2023-05-07 07:27:24 +0000
commite65760a349112abce39404ca50f6bc2f1301bed9 (patch)
treec2484af8006961d95dcf39cf16c3749100a713c9 /doc/snac.1
parent7d3a909598c1fc9def2069aeeccda58e305c738a (diff)
parent6a1cc55676eaf18ecadb42b86474aaef73cf9805 (diff)
Merge pull request 'master' (#1) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/poesty/snac2/pulls/1
Diffstat (limited to 'doc/snac.1')
-rw-r--r--doc/snac.130
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/snac.1 b/doc/snac.1
index ec8df64..ef84f3d 100644
--- a/doc/snac.1
+++ b/doc/snac.1
@@ -220,6 +220,36 @@ Please take note that they will show your timeline in a 'Mastodon fashion'
post display with the most active threads at the top that the web interface of
.Nm
provides.
+.Ss Implementing post bots
+.Nm
+makes very easy to post messages in a non-interactive manner. This example
+posts a string:
+.Bd -literal -offset indent
+uptime | snac note $SNAC_BASEDIR $SNAC_USER -
+.Ed
+.Pp
+You can setup a line like this from a
+.Xr crontab 5
+or similar. Take note that you need a) command-line access to the same machine
+that hosts the
+.Nm
+instance, and b) write permissions to the storage directories and files.
+.Pp
+You can also post non-interactively using the Mastodon API and a command-line
+http tool like
+.Xr curl 1
+or similar. This has the advantage that you can do it remotely from any host,
+anywhere; the only thing you need is an API Token. This is an example:
+.Bd -literal -offset indent
+curl -X POST https://$SNAC_HOST/api/v1/statuses \\
+--header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)"
+.Ed
+.Pp
+You can obtain an API Token by connecting to the following URL:
+.Bd -literal -offset indent
+https://$SNAC_HOST/oauth/x-snac-get-token
+.Ed
+.Pp
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev DEBUG