Cross posting in X and Bsky

2025 January 23

It's been really annoying to always have to crosspost around Bluesky and X. So I decided to fix it. I created a tiny script that uses the X and Bsky APIs respectively to crosspost through each platform.

It works by connecting to both APIs and posting through your account. You are going to need a bunch of environment variables to setup:

export CONSUMER_KEY='dummy_consumer_key'
export CONSUMER_SECRET='dummy_consumer_secret'
export BEARER_TOKEN_X='dummy_bearer_token'
export ACCESS_TOKEN='dummy_access_token'
export ACCESS_TOKEN_SECRET='dummy_access_token_secret'
export BLUESKY_HANDLE='dummy_bluesky_handle'
export BLUESKY_PASSWORD='dummy_bluesky_password'

I am using uv to run the script in a self contained manner and you can run it in the following way:

uv run /path/to/single_poster.py "<message>"

I then used alias:

alias post='uv run single_poster.py'

So that I can just post with:

post "<thought>"

I might add more funcionality in the future but for now it's already doing it's job! The code can be found here.


Back to website