Mastodon Shell bot
Executing toots as shell commands.
Command Tweets forms like
PREFIX shell-command comment
: by default, and this is configuable.
comment is optional, and must begins with
#. This can use to avoid toot duplication.
shell-command string will be executed.
:date # this is a comment
In fact, commands will be executed not through shell (contrary to the name).
|), if-syntax, for-syntax cannot use.
Moreover allowing commands are specified by a white list for security.
config (YAML file)
$ cat config.yml mastodon: server: mstdn.jp access_token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa port: 8080 prefix: ":!" commands: - echo - date - tenki
PREFIX can be specified as
This is written as regular expression.
commands is the list of allowed commands.
Each command should be executable (note to PATH).
Additionally, all executable files under
./bin is executable (no need to write in
All script has no input (stdin).
The output (stdout + stderr if exsists) will be posted (as a reply tweet).
When stdout forms
, bot will RT it (please see
bin/ika as a sample).
Image (text with medias)
Follow the local paths of the images (separated by space) after
IMAGE at the 1st line.
IMAGE (path1) (path2) (path3) (text)
The bot will tweets the text with medias.
- (nodebrew is recommended)
- node modules