Crosspost from Twitter to Mastodon and Bluesky (based on Nitter)
It is increasingly hard to use and host a public Nitter instance.
As a result, it is probably not a good idea to use it with a public Nitter instance.
Check out sekai-soft/freebird for a guide on how to self-host your own Nitter instance alongside nitter-xposter
.
- Twitter crawling is based on Nitter, so only public accounts are supported.
- Supported tweet types
- Text
- Retweet
- Image
- Replies to your own Tweet
- Video
The easiest way to use this program is to run it as a docker compose service on your NAS or a VPS.
You need to create a developer application on your Mastodon instance first
- Go to
https://<your-mastodon-instance>/settings/applications/new
- On the form, put
nitter-xposter
forApplication name
- Under
Scopes
, uncheckread
,write
andfollow
checkboxes. Checkwrite:media
andwrite:statuses
checkboxes. - Click
Submit
- Go to
https://<your-mastodon-instance>/settings/applications
and click thenitter-xposter
application you just created - You will need the following
Client key
Client secret
Your access token
After obtaining the credentials, you can use the following docker-compose.yml
to run the program
version: '3'
services:
app:
image: ghcr.io/k-t-corp/nitter-xposter:latest
volumes:
- ./dbs:/app/dbs
# - ./post.sh:/app/post.sh # you can optionally mount a shell script at /app/post.sh to run after every Nitter crawl to perform tasks such as sending a heartbeat
environment:
SQLITE_FILE: /app/dbs/db.db
NITTER_HOST: <ENTER YOUR NITTER HOST HERE>
NITTER_HTTPS: <'true' OR 'false'> # by default 'true'; set to 'false' if your Nitter instance does not support https
TWITTER_HANDLE: <REPLACE WITH YOUR TWITTER USERNAME, WITHOUT @>
MASTODON_HOST: <REPLACE WITH YOUR MASTODON INSTANCE, e.g. mastodon.ktachibana.party>
MASTODON_CLIENT_ID: <REPLACE WITH YOUR MASTODON CLIENT KEY>
MASTODON_CLIENT_SECRET: <REPLACE WITH YOUR MASTODON CLIENT SECRET>
MASTODON_ACCESS_TOKEN: <REPLACE WITH YOUR MASTODON ACCESS TOKEN>
MASTODON_STATUS_LIMIT: '10' # set the maximum of statuses to be posted at once
restart: always
This will crawl the Nitter RSS for your Twitter username every 5 minutes, and crosspost the tweets to your Mastodon account.
You can use the following docker-compose.yml
to run the program
version: '3'
services:
app:
image: ghcr.io/k-t-corp/nitter-xposter:latest
volumes:
- ./dbs:/app/dbs
# - ./post.sh:/app/post.sh # you can optionally mount a shell script at /app/post.sh to run after every Nitter crawl to perform tasks such as sending a heartbeat
environment:
SQLITE_FILE: /app/dbs/db.db
NITTER_HOST: <ENTER YOUR NITTER HOST HERE>
NITTER_HTTPS: <'true' OR 'false'> # by default 'true'; set to 'false' if your Nitter instance does not support https
TWITTER_HANDLE: <REPLACE WITH YOUR TWITTER USERNAME, WITHOUT @>
BSKY_HANDLE: ${BSKY_HANDLE}
BSKY_PASSWORD: ${BSKY_PASSWORD}
BSKY_STATUS_LIMIT: '10' # set the maximum of statuses to be posted at once
INTERVAL_MINUTES: '30' # it is recommended to set the polling interval at least 5 minutes so that it doesn't violate Bluesky's createSession rate limit https://docs.bsky.app/docs/advanced-guides/rate-limits
restart: always
Consider support us on Patreon :)
python -m unittest discover