Web & net culture

Mastodon + toot: Post from the command line

You can also toot from the terminal - and that's not just fun for scripts!

Since maybe not sooo well arrived in the everyday vocabulary: Tooten = twitter. And of course you can also issue Toots via a command line client – ​​as quickly and easily as rarely. That it is the tool toot Open source software is almost self-evident.

set up toot

The tool toot does too ... oh, too cheap ;) toot doesn't have too many functions: you can set toots, build in content warnings and determine the visibility. First of all you have to go through the program npm Install the package manager for the JavaScript runtime environment Node.js:

npm install -g toot

The "-g" stands for global, so toot is available system-wide. In the article to Checkmk notifications in Mastodon However, you can see that it is not that easy with the global in some scenarios.

Then your toot simply calls over

toot

on. Since there is no configuration yet, the setup wizard starts. First he asks for the mastodon host, here in the example:

social.anoxinon.de

Then toot generates one Link, you visit in the browser - where you approve the authorization.

authorization for toot in the browser.
Authorization for toot

You will then receive a code to copy:

authorization code.
Copy and paste in the terminal

Toot is already waiting in the terminal with a request for this code – insert, confirm, done. Here is the whole terminal session again:

toot in bash.
In three steps, toot is ready for use

post posts

On Mastodon itself you can now find under Settings/Account/Approved Apps the new toot app. You can also revoke the authorization here.

toots in mastodon.
Toots out of the terminal

A simple is enough to toot

toot "Testing cli client."

Which then unsurprisingly looks like this on Mastodon:

toots in mastodon.
Toots out of the terminal

With options it could look like this:

toot --visibility unlisted --cw "Vorsicht: Der folgende Text ist irritierend." "Peter kaut Hunde."

The visibility shows the toot when setting unlisted public, but not in timelines or search. cw stands for Content Warning, shows the first text immediately and the second only after a click.

With toot, not only can you quickly toot a little text, but you can also set up automation very quickly. The one mentioned above shows an example of this Checkmk article.

More on Mastodon. Or more at Mastodon.

Mirco Lang

Freelance journalist, Sauerland exile, (fairly old) skateboarder, graduate computer scientist, retail salesman, open source nerd, Checkmk handbook writer. Ex-Saturn'ler, Ex-Data-Becker'ler, Ex-BSI'ler. First contact with computers: ca. 1982 - a friend's big brother's C64. If you want to read more about open source, Linux and craft stuff and support Tutonaut here: About Coffee sponsorship via Paypal.I'm always happy. In advance: Thank you! Do not miss: cli.help and VoltAmpereWatt.de. New: Mastodon

Leave a Comment

Your e-mail address will not be published. Required fields are marked with * marked

This website uses Akismet to reduce spam. Learn more about how your comment data is processed.

Back to Top button
Close

Oops!

Please deactivate your ad blocker.