⬅️ 11ty Footnotes 🧭 11ty iFramely Bookmarks ➡️

11ty RSS Activepieces

by Jay Cuthrell

This week is a look at enhancing 11ty by extending the RSS feed of my newsletter archive and blog to include an enclosure that borrows from Open Graph image functionality with the intent of populating the input for Activepieces as a POSSE tool for posting to Mastodon and LinkedIn. That was a mouthful.

My inspiration? spyglass.org

https://www.linkedin.com/feed/update/urn:li:activity:7161019682546733056/

Indeed! 💯 This is why I too am frustrated with basic social network automation and realizing how challenging it is across the various platforms.

Open Web vs Open Weep.

I was just reflecting on the last remaining manual steps for my weekly newsletter of copying and pasting a manual update for Mastdon and LinkedIn and each one has the quirks of unfurl or hashtag handling. And then… an idea. 💡

Getting Informed

Thanks to the hard work of others and the growing number of options for cross-posting on social networks, accomplishing the goal of automatic posting to wildly different social networks like Mastodon and LinkedIn was not as difficult as I imagined.

Is my approach rock solid Enterprise grade CMS with queue depth tolerance for transient flailing within interdependent systems?

Sir. This is an Arby’s.

Does it scratch my itch? Yes. For now.

I wanted to simplify my POSSE.

Having tried a few other social media automation options before, I didn’t want to use IFTTT and I didn’t want to use Zapier.

What I came up with:

Here is the recipe I used…

RSS 2.0 enclosure

First, I’m using awesome plugins already as part of my Eleventy Excellent setup like RSS and also using the included functionality of Open Graph images. One of the benefits is a meta info functionality that automates adding the generated image for each post.

<meta
  property="og:image"
  content="{{ meta.url }}{% if (layout == 'post') %}/assets/images/social-preview/{{
    title | slugify
  }}-preview.jpeg
  {% else %}{{ meta.meta_data.opengraph_default }}
  {% endif %}"
/>

Second, RSS 2.0 supports enclosures and MIME types.

Putting that all together, this code snipped extends the RSS 2.0 plugin template file feed.njk. This means we have an input image that can be used to satisfy the requirements for creating a richer LinkedIn post format.

     <enclosure url="{{ meta.url }}/assets/images/social-preview/{{
  post.data.title | slugify
}}-preview.jpeg" type="image/png" />

If you are a more visual person, this screenshot might be helpful to illustrate how simple this addition is.

Visual Studio Code diff of feed.njk

Activepieces RSS inputs

First, the LinkedIn post format requirement for an image using an Activepieces Flow Step needs to be satisfied by the RSS input.

Activepices Flow RSS input

Second, the essential information like title, url, author, and image can be customized for LinkedIn fields in the next Activepieces Flow Step.

(Yes, LinkedIn is a bit extra to post successfully.)

Activepices Flow LinkedIn fields top

(And yes, LinkedIn has more extra after that too in order to post successfully.)

Activepices Flow LinkedIn fields bottom

Third, the RSS input can also be sent to other services like Mastdon which have lesser requirements than the LinkedIn Activepieces Flow Step.

Activepieces Flows

Finally – putting it all together by pressing the “Retest” button a few times and reloading LinkedIn…

Activepices Flow posting an RSS input to LinkedIn

Oh, and for Mastodon, the same process but much less to fill into the Activepieces Flow Step form.

Activepices Flow posting an RSS input to Mastodon

In case you find examples useful, I’ve also exported my Activepieces Flows as json files.

https://github.com/JayCuthrell/activepieces

Next, I’ll be testing this new approach to see if it works as expected for Fudge Sunday. My understanding is that LinkedIn OAuth 2.0 tokens expire at 2 months by default.

Further, I’ll probably stay manual using Activepieces via Webhook instead of an RSS feed trigger for a few more iterations. I need to check to ensure that my assumptions don’t result in my being blocked from LinkedIn if I make a mistake somewhere in my Activepieces settings.

For example, to share this post to both Mastodon and LinkedIn I would replace the RSS trigger before with a Webhook trigger as follows:

curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data \
"{\"title\": \"11ty RSS Activepieces\",\"url\": \"https://fudge.org/archive/11ty-rss-activepieces/\",\"desc\": \"A new post\",\"opengraph\": \"https://fudge.org/assets/images/social-preview/11ty-rss-activepieces-preview.jpeg\"}" \
https://cloud.activepieces.com/api/v1/webhooks/UNIQUE_ENDPOINT_GOES_HERE

Activepieces Flow using a Webhook input to both Mastdon and Linkedin

Said another way, I might simply end up writing my own Python script and setting up another cron job like scenario that calls Activepieces running as a docker image or a just-in-time Pulumi deployed instance or… well, you get the idea. 🤓

Or, I just give up on posting to LinkedIn entirely. 🤣

Until then…

Travel Note for SxSW 2024

I’m going to SxSW 2024.

Will you be at SxSW 2024 too?

If so – let’s catch up in the real world.

I’m also publishing my SxSW 2024 schedule picks (so far).

Disclosure

I am linking to my disclosure.


p.s. As I’ve gotten older, I have come to appreciate getting snail mail. If you have time to drop me a postcard that would be amazing. ✉️


View this page on GitHub.

⬅️ 11ty Footnotes 🧭 11ty iFramely Bookmarks ➡️
Share and discuss on LinkedIn or HN