From RSS feed to Bluesky and Mastodon via n8n
I am consistently taking notes in the raw section of my blog and wanted to keep posting new posts on Mastodon and Bluesky as URLs. I used n8n to achieve this automation successfully – even though n8n doesn't have an official Mastodon and Bluesky node.
In this post, I will explain how I set this up:
At first, I used the RSS Feed Trigger node in n8n
so that it auto-triggers every time a new raw note is published. It gives me the most recent post in the below format, and I can use the data from here to publish on both platforms.
[
{
"title": "",
"link": "",
"pubDate": "",
"content": "",
"contentSnippet": "",
"id": "",
"isoDate": ""
}
]
From RSS feed to Mastodon
I needed the following 3 things for this automation via n8n:
- RSS feed URL: it's
deepakness.com/feed/raw.xml
in my case - Mastodon URL instance: my account is at
mastodon.social
- Your Mastodon access token: visited
[INSTANCE_URL]/settings/applications
, created a new application with fullwrite
scope, and got the access token
After the previous RSS Feed Trigger node in n8n, I created another HTTP Request node, and entered the following information:
- Authentication: None
- Request Method: POST
- URL:
https://[INSTANCE_URL]/api/v1/statuses?access_token=[ACCESS_TOKEN]
- Ignore SSL Issues (Insecure): OFF
- Response Format: JSON
- JSON/RAW Parameters: OFF
- Options: Nothing
- Body Parameters: Nothing
- Headers: Nothing
- Query Parameters:
- Name: status
- Value: [POST_CONTENT] from previous nodes
And this simply worked, I didn't have to do anything else at all. If you're interested, you can learn more by going through their documentation.
From RSS feed to Bluesky
First, I needed to create a Bluesky Session and then only I was able to publish. For this, I needed the following things:
- App password: Created a new app and got the app password from
bsky.app/settings/app-passwords
page - Profile identifier: Your profile identifier
[username].bsky.social
Node 1: HTTP Request
First, you need to create a HTTP Request node to get the Session ID. Fill in the following info:
- Authentication: None
- Request Method: POST
- URL:
https://bsky.social/xrpc/com.atproto.server.createSession
- Ignore SSL Issues (Insecure): OFF
- Response Format: JSON
- JSON/RAW Parameters: OFF
- Options
- Body Parameters:
- Name: identifier
- Value:
deepakness.bsky.social
- Name: password
- Value: [APP_PASSWORD]
- Headers: Nothing
- Query Parameters: Nothing
From here, you need to get the accessJwt
token in the next node to be able to publish the post.
Node 2: Date & Time
Yes, the date parameter is required in the Bluesky API so you need to add the Date & Time node and get the current time:
- Operation: Get Current Date
- Include Current Time: ON
- Output Field Name: currentDate
- Options: Nothing
Node 3: HTTP Request
Now, I needed another HTTP Request node to be able to actually publish. Below are the options:
- Method: POST
- URL:
https://bsky.social/xrpc/com.atproto.repo.createRecord
- Authentication: None
- Send Query Parameters: OFF
- Send Headers: ON
- Specify Headers: Using Fields Below
- Header Parameters:
- Name: Authorization
- Value: Bearer [accessJwt_from_previous_node]
- Send Body: ON
- Body Content Type: JSON
- Specify Body: Using JSON
- JSON: see here
- Options: Nothing
So far, it's working for me but I might further improve it in the future.
Comment via email