Changes: 23rd of January 2025
The IndieWeb says you should POSSE.
Publish (on your) Own Site, Syndicate Elsewhere.
So I’ve set some things up for that.
Mastodon
Initially I wanted to use EchoFeed, but for some reason it couldn’t fetch the RSS feed. 🤷♂️
So I decided to use MastoRSSbot as a GitHub action in the repository.
Their example assumes you’d set it up as a cronjob, but that seemed a bit wasteful. It might be days, or weeks, before I post anything new. Since I can guarantee there won’t be anything new as long as the deploy pipeline hasn’t run, might as well trigger it on a merge to main
instead, and make sure it depends on the fact that the updated site has been published.
name: FeedBot
on:
workflow_run:
workflows:
branches:
types:
- completed
jobs:
rss-to-mastodon:
runs-on: ubuntu-latest
steps:
- name: Generate cache key
uses: actions/github-script@v6
id: generate-key
with:
script: |
core.setOutput('cache-key', new Date().valueOf())
- name: Retrieve cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/MastoRSSbot
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-
- name: GitHub
uses: 'rich-howell/mastofeedbot@v1'
with:
# This is the RSS feed you want to publish
rss-feed: https://nizzlay.com/atom.xml
# This is your instance address
api-endpoint: https://indieweb.social
# This is the secret you created earlier
api-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
# This is a path to the cache file, using the above cache path
cache-file: ${{ github.workspace }}/MastoRSSbot/cache.json
Initially it did post for each item in the RSS feed, which was a bit spammy, but I’m assuming that’s because it had to build up a cache. I have since cleaned up those posts, so let’s see how it goes from now on.
Twitter (or X?)
Regardless of our opinions of Twitter[1], it’s still a place we can syndicate to, so that’s what I’ve set up.
Here I used Zapier, which seems to have no issues with the feed. Set Zapier to check the RSS feed, and whenever anything new is there it will post it to Twitter (through Buffer).
Had to go through Buffer, since Twitter is charging an obscene amount of money to use their API, which Zapier (understandably) decided not to want to pay.
IndexNow
Let’s consider search engines also a place that can be syndicated towards. Sure they’ll find the site by themselves eventually, but it’s nice to let them know when changes have happened, so the crawling can be more efficient.
For previous websites I had a simple curl in the pipeline to ping, something like:
- curl https://google.com/ping?sitemap=https://nizzlay.com/sitemap.xml
- curl https://www.bing.com/ping?sitemap=https://nizzlay.com/sitemap.xml
Which would basically tell them to check out this sitemap, as something has been updated. But it seems both Google and Bing have since deprecated and removed this method.
It seems that Bing, and some other search engines, have switched to IndexNow. For which I’ve also implemented another GitHub action. Again only triggering after I’ve actually deployed a new version of the site, no need for a cron.
This action takes the latest version of my sitemap, checks which pages have been updated in the last day, and sends that to IndexNow as an array of URL’s.
As recommended in the README
, I have dynamically added the key file website by adding it into the static folder before building using Zola, which will simply copy the file to be deployed.
- name: Setup IndexNow # Generate files dynamically to prevent them from being leaked in public repositories.
run: echo ${{ secrets.INDEXNOW_KEY }} > static/${{ secrets.INDEXNOW_KEY }}.txt
And then implement the action:
name: 'IndexNow'
on:
workflow_run:
workflows:
branches:
types:
- completed
jobs:
check-and-submit:
runs-on: ubuntu-latest
steps:
- name: indexnow-action
uses: bojieyang/indexnow-action@v2
with:
sitemap-location: 'https://nizzlay.com/sitemap.xml'
key: ${{ secrets.INDEXNOW_KEY }}
I opened it up today, for the first time in forever. The timeline was full of people I don’t follow, creating a whole lot of drama about things I don’t care about. Fine for syndicating towards, but you won’t find me there for anything else. ↩