Post to Mastodon and Twitter simultaneously from the command line.
$ npm install -g ashur/ppppost
- Node 10.0 (or newer) & NPM
$ ppppost add @tinyskylines
By default, bot definitions (including access tokens) are stored in a plaintext JSON file located at ~/.config/ppppost/config.json
.
💡 You can override this location by setting the environment variable
PPPPOST_CONFIG
You'll be prompted for the following details when configuring a bot for Mastodon:
- Instance (ex.,
mastodon.social
) - Access Token
- Visibility (
direct
,private
,unlisted
, orpublic
)
You can generate a new Mastodon application at https://<instance>/settings/application
, then find the Access Token
on the application's settings page.
When configuring a bot for Twitter, you'll be prompted for the following:
- Consumer Token
- Consumer Secret
- Access Token
- Access Token Secret
These are available for existing Twitter applications at https://apps.twitter.com.
To post a message, use the to <bot>
command:
$ ppppost to @namogenbo --message "Happy “National Canteen Raising Month”! #NaCaRaMo 🎉"
⚠️ Note — ppppost does not enforce any message length limit on either Mastodon or Twitter
The --images
option accepts a comma-separated list of file paths:
$ ppppost to @schneiderlens --images tail.png,teeth.png,hooves.png
To add captions to your images, the --captions
option accepts a comma-separated list that corresponds to the --images
list:
$ ppppost to @schneiderlens --images tail.png,teeth.png --captions "The bushy tail.","Big teeth."
To preserve commas in a caption, escape them with \
:
$ ppppost to @schneiderlens --images tail.png,teeth.png --captions "The bushy\, bushy tail.","Big teeth."
By default, ppppost
will post to all services defined for the bot. To post to just one service, use the [-M|--mastodon]
or [-T|--twitter]
options.
A more fully baked version of this tool should include:
- Support for OAuth-based authentication (instead of prompting for tokens and secrets)