From cf8d91147b1a0233ba5d3d98a8806bd2a87c222d Mon Sep 17 00:00:00 2001 From: default Date: Thu, 4 May 2023 05:52:35 +0200 Subject: Updated documentation. --- doc/snac.1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc') diff --git a/doc/snac.1 b/doc/snac.1 index ec8df64..91d7e85 100644 --- a/doc/snac.1 +++ b/doc/snac.1 @@ -220,6 +220,20 @@ 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. .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev DEBUG -- cgit v1.2.3 From dd290c8e226c7d78dc74695d26e28ec8bf4eab26 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 4 May 2023 06:38:24 +0200 Subject: Updated documentation. --- doc/snac.1 | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc') diff --git a/doc/snac.1 b/doc/snac.1 index 91d7e85..c52eba9 100644 --- a/doc/snac.1 +++ b/doc/snac.1 @@ -234,6 +234,17 @@ 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.example.com/api/v1/statuses \ +--header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)" +.Ed +.Pp .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev DEBUG -- cgit v1.2.3 From d46bf8837c1c6654868170a293352d12f6d84962 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 4 May 2023 06:40:51 +0200 Subject: Updated documentation. --- doc/snac.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/snac.1 b/doc/snac.1 index c52eba9..0d36f5d 100644 --- a/doc/snac.1 +++ b/doc/snac.1 @@ -241,10 +241,11 @@ http tool like 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.example.com/api/v1/statuses \ +curl -X POST https://snac.example.com/api/v1/statuses \\ --header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)" .Ed .Pp +You can obtain an API Token from a mobile app. .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev DEBUG -- cgit v1.2.3 From cd71bd08bffc58f01610f3c13ff00c7ec214fd6a Mon Sep 17 00:00:00 2001 From: default Date: Thu, 4 May 2023 11:59:18 +0200 Subject: Updated documentation. --- doc/snac.1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/snac.1 b/doc/snac.1 index 0d36f5d..ef84f3d 100644 --- a/doc/snac.1 +++ b/doc/snac.1 @@ -241,11 +241,15 @@ http tool like 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.example.com/api/v1/statuses \\ +curl -X POST https://$SNAC_HOST/api/v1/statuses \\ --header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)" .Ed .Pp -You can obtain an API Token from a mobile app. +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 -- cgit v1.2.3