diff options
Diffstat (limited to 'doc/snac.1')
| -rw-r--r-- | doc/snac.1 | 30 |
1 files changed, 30 insertions, 0 deletions
| @@ -220,6 +220,36 @@ Please take note that they will show your timeline in a 'Mastodon fashion' | |||
| 220 | post display with the most active threads at the top that the web interface of | 220 | post display with the most active threads at the top that the web interface of |
| 221 | .Nm | 221 | .Nm |
| 222 | provides. | 222 | provides. |
| 223 | .Ss Implementing post bots | ||
| 224 | .Nm | ||
| 225 | makes very easy to post messages in a non-interactive manner. This example | ||
| 226 | posts a string: | ||
| 227 | .Bd -literal -offset indent | ||
| 228 | uptime | snac note $SNAC_BASEDIR $SNAC_USER - | ||
| 229 | .Ed | ||
| 230 | .Pp | ||
| 231 | You can setup a line like this from a | ||
| 232 | .Xr crontab 5 | ||
| 233 | or similar. Take note that you need a) command-line access to the same machine | ||
| 234 | that hosts the | ||
| 235 | .Nm | ||
| 236 | instance, and b) write permissions to the storage directories and files. | ||
| 237 | .Pp | ||
| 238 | You can also post non-interactively using the Mastodon API and a command-line | ||
| 239 | http tool like | ||
| 240 | .Xr curl 1 | ||
| 241 | or similar. This has the advantage that you can do it remotely from any host, | ||
| 242 | anywhere; the only thing you need is an API Token. This is an example: | ||
| 243 | .Bd -literal -offset indent | ||
| 244 | curl -X POST https://$SNAC_HOST/api/v1/statuses \\ | ||
| 245 | --header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)" | ||
| 246 | .Ed | ||
| 247 | .Pp | ||
| 248 | You can obtain an API Token by connecting to the following URL: | ||
| 249 | .Bd -literal -offset indent | ||
| 250 | https://$SNAC_HOST/oauth/x-snac-get-token | ||
| 251 | .Ed | ||
| 252 | .Pp | ||
| 223 | .Sh ENVIRONMENT | 253 | .Sh ENVIRONMENT |
| 224 | .Bl -tag -width Ds | 254 | .Bl -tag -width Ds |
| 225 | .It Ev DEBUG | 255 | .It Ev DEBUG |