The Twitter platform is using https://github.com/PLhery/node-twitter-api-v2
The Twitter api was being rebuild when Elon Musk bought it and broke it. Part of it now runs on OAuth1, and part of it on Oauth2, and you have to configure both. Hopefully, one day, the 'O1' keys will not be needed anymore.
- go to https://developer.twitter.com/
- create a few developer account
- you get a project and an app, rename those
- set up User authentication settings
- read and write
- fairpost is a bot
- redirect url with host/port from your .env (http://localhost:8000/callback)
- website https://github.com/commonpike/fairpost
- From the Oauth 01 settings
- generate Api Key and secret
- save these in your global .env as
FAIRPOST_TWITTER_OA1_API_KEY
FAIRPOST_TWITTER_OA1_API_KEY_SECRET
- generate access token and secret, make sure it is read and write
- save these in your global .env as as
FAIRPOST_TWITTER_OA1_ACCESS_TOKEN
FAIRPOST_TWITTER_OA1_ACCESS_TOKEN_SECRET
- From the OAuth 2 settings
- save
FAIRPOST_TWITTER_CLIENT_ID
in your global .env - save
FAIRPOST_TWITTER_CLIENT_SECRET
in your global .env
- save
- Add 'twitter' to your
FEED_PLATFORMS
in your usersstorage.json
This token should last forever (?)
- call
./fairpost.js @userid setup-platform --platform=twitter
- follow instructions from the command line
- call
./fairpost.js @userid test-platform --platform=twitter
One fairpost user can only manage one feed. If you create a second user, you can use the same app to manage a different feed. OAuth2 allows you to enable the app for your second account, but the OAuth1 part is tied to your first account and requires you to specify an 'additional_owner' for the uploaded media.
- call
./fairpost.js create-user --userid=foo
- call
./fairpost.js @foo setup-platform --platform=twitter
- follow instructions from the command line
- call
./fairpost.js @foo test-platform --platform=twitter
- from the previous
test-platform
result, copy theoauth2:id
- set this as the
TWITTER_OA1_ADDITIONAL_OWNER
in your users storage.json
TWITTER_PLUGIN_SETTINGS
- a json object describing / overwriting the plugins used to prepare posts