I just figured out the recipe to post Cards to Bluesky, thanks to some of the threads here (now closed so I can’t comment) But it was based on this thread:
Essentially, I watch our own RSS feed for new items, grab the image URL, then run the Create session to get the token required. Then upload the image, create the JSON then post to Bluesky.
It was just down to the syntax in the JSON module, add the $type and $link parameters as described, no need to escape.
The additional step is to extract the image url from the RSS using an HTTP Get a file request which will give you the blob and the size parameters.
Here’s my format for the image in the RSS feed (need to set the property in the opening RSS tag)
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" >
.....
..... Inside <item>
<media:content medium="image" url="myurl" /> - must be under 1mb
Then you create the JSON structure using the generate option, (paste the code below) module [4]
{
"repo": "your_did_here", the did returned in the headers of your create session Http call [3]
"collection": "app.bsky.feed.post",
"record": {
"text": "Just a test post via API",
"createdAt": "2024-05-13T14:52:21.422Z"
"$type": "app.bsky.feed.post",
"text": "post which embeds an external URL as a card", headline or whatever from [7]
"createdAt": "now",
"embed": {
"$type": "app.bsky.embed.external",
"external": {
"uri": "https://bsky.app", URL of item from RSS feed [7]
"title": "Bluesky Social", from item in RSS Feed [7]
"description": "See what's next.", from item in RSS Feed [7]
"thumb": {
"$type": "blob",
"ref": {
"$link": "slink from sending the image to BSky HTTP post" in HTTP module [9]
},
"mimeType": "image/png", - you can set this from the data:blob:mimeType [8]
"size": map to data: blob : size from image to BS [8]
}
}
}
}
}
Hope this helps somebody