Skip to content
/ ppppost Public

👻 Post to Mastodon and Twitter simultaneously from the command line

Notifications You must be signed in to change notification settings

ashur/ppppost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👻 ppppost

Post to Mastodon and Twitter simultaneously from the command line.

Installation

$ npm install -g ashur/ppppost

Requirements

Adding a Bot

$ 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

Mastodon

You'll be prompted for the following details when configuring a bot for Mastodon:

  • Instance (ex., mastodon.social)
  • Access Token
  • Visibility (direct, private, unlisted, or public)

You can generate a new Mastodon application at https://<instance>/settings/application, then find the Access Token on the application's settings page.

Twitter

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.

Posting

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.

TODO

A more fully baked version of this tool should include:

  • Support for OAuth-based authentication (instead of prompting for tokens and secrets)

About

👻 Post to Mastodon and Twitter simultaneously from the command line

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published