eleventy-base-blog icon indicating copy to clipboard operation
eleventy-base-blog copied to clipboard

Auto posting to social media

Open rdela opened this issue 2 years ago • 3 comments

If one wanted to auto post one's new screeds to say, Mastodon, how would one go about that?

I am looking for the equivalent to this in Eleventy land https://github.com/janboddez/share-on-mastodon

rdela avatar Mar 01 '23 19:03 rdela

An option: Zapier - RSS to Mastodon https://community.zapier.com/code-webhooks-52/rss-to-mastodon-19131

You have first to create an application on Mastodon in your Developper section, for example

https://mastodon.social/settings/applications

Add the necessary information (url is https://zapier.com), then uncheck all the boxes already checked, and check write:statuses to publish statuses on Mastodon.

Then create the Webhook in your Zap, with:

URL : https://mastodon.social/api/v1/statuses?access_token=XXX : change the .social depending on your Mastodon account. The token is in your Mastodon app Data : put “status” and add the Post Title / Post Link…

rdela avatar Mar 02 '23 22:03 rdela

On Zapier forum link in prev comment:

FYI, this additional article helped me to actually get it working!

~~https://lukas.io/page:2~~

better link https://lukas.io/autoposting-rss-to-mastodon

rdela avatar Mar 02 '23 22:03 rdela

I accomplished this with the webmentions netlify plugin and bridgy

eleventyConfig.addGlobalData('isProductionBuild', process.env.NETLIFY && process.env.CONTEXT === 'production');

Since I'm scanning the feed each time I build, I need to include the mention inside the post content

<div class="e-content">
  <template webc:nokeep @raw="content"></template>
  <a id="tldr"
     webc:if="watch || isProductionBuild"
     href="https://brid.gy/publish/mastodon"></a>
</div>

bennypowers avatar Apr 14 '23 09:04 bennypowers