# My Indie Likes Workflow

- Link: https://cagrimmett.com/2023/01/22/my-indie-likes-workflow/
- Published: 2023-01-22T14:25:19-05:00
- Author: Chuck Grimmett

As part of trying to implement a website-first [POSSE](https://indieweb.org/POSSE)
workflow, I wanted to start with posting [Likes](https://indieweb.org/like) to my
website and sending out [webmentions](https://indieweb.org/webmention) from them.
That is a lot of what I used to tweet out. Why should a record of what I like be
stored elsewhere?

It took me a little while to figure out what I wanted this system to look like, 
but once I landed on it and verified it could work with a couple quick tests, I 
got to work building it out and it has been running smoothly for a couple of weeks.

## Inputs and Outputs

Where do I read content the most and how can I get links from there into my website?
This was my research question before Christmas.

When I’m at my computer, posting likes is fairly painless, though it is a multistep
process:

 1. Go to my website
 2. Log in
 3. Click to add a new like
 4. Paste in the URL
 5. Add commentary
 6. Click publish

There is more friction on mobile, which is where I tend to read a lot of content.

[Jan Boddez pointed out](https://jan.boddez.net/notes/2cdd7ef4c7) that using Micropub
reduces that friction. Unfortunately [I couldn’t find clients that reliably worked for me on iOS.](https://cagrimmett.com/notes/2e0554dfd9/)

So, that put me back in the realm of looking for solutions. I did what I do on most
projects: Look where the inputs are coming from.

 * I spend most of my time reading articles on mobile.
 * 50% of what I want to post as Likes comes from content already in my RSS feed
   reader.
 * The rest come from a mix of social, email, general browsing (things like news.
   ycombinator.com, pinboard.in/popular), and Slack groups.

Whatever I choose has to incorporate all of these channels and has to work from 
all of my devices (macOS, iOS, and iPadOS).

I decided to handle likes coming from the various sources in two ways:

 1. A solution specifically for my RSS reader
 2. A solution for everything else

## From the RSS Reader

My RSS reader of choice is [NetNewsWire](https://netnewswire.com/) (I used it before
the Black Pixel era too), and I use [Feedbin](https://feedbin.com/) as my feed syncing
service (and the email -> RSS functionality).

Feedbin and NetNewsWire supports stars, so I decided that anything I star in Feedbin
should be posted as a Like on my site.

[Feedbin has an API](https://github.com/feedbin/feedbin-api) that makes starred 
entries available in two ways:

 * As a filter option on the Entries endpoint
 * As its own endpoint that returns a list of IDs, which then need a follow-up API
   call to fetch the contents

I thought about a couple ways of fetching those starred items and turning them into
posts. What I landed on is a simple plugin that polls the API once an hour, posts
new items as Likes, then saves the IDs of the posts it processed so they won’t be
processed again.

This was the first proper WordPress plugin I’ve build and I learned a lot in the
process:

 * The proper way to set up and tear down dependencies on install and uninstall 
   hooks.
 * Working with WP Cron.
 * Setting up plugin settings pages and saving options.

The Likes are posted using [Jan Boddez’s IndieBlocks plugin](https://wordpress.org/plugins/indieblocks/)
context block, which also handles sending out webmentions.

Here is the plugin, free to use or remix:

![](https://opengraph.githubassets.com/c5b4775bee2ecaa98813b1974019e3a4f34348b135434bb3048d66685f5334fa/
cagrimmett/feedbin-stars-to-indie-likes)

GitHub – cagrimmett/feedbin-stars-to-indie-likes: Takes starred posts from Feedbin
and turns them into Indie Likes on a WordPress site

Takes starred posts from Feedbin and turns them into Indie Likes on a WordPress 
site – GitHub – cagrimmett/feedbin-stars-to-indie-likes: Takes starred posts from
Feedbin and turns them into Indie Likes on a WordPress site

github.com

If I were to remake this from scratch, I’d probably save the post permalinks instead
of the post IDs to the database to check. That seems slightly more hardened, and
also ensures I’m not posting duplicate Likes if a Feedbin ID ever changes.

An improvement I’d like to make: Add [a filter to load the plugin updates from GitHub](https://developer.wordpress.org/reference/hooks/update_plugins_hostname/)
instead of WP.org with the [new Update URI](https://make.wordpress.org/core/2021/06/29/introducing-update-uri-plugin-header-in-wordpress-5-8/)
header.

## Everything Else

For everything else I decided to piggyback off of a bookmarking solution I use. 
Bookmarking is pretty fast and shared across all of my devices, so I set up a specific
folder called Likes and any time something gets added to that folder it gets turned
into a Like.

I currently use [Larder.io](https://larder.io/) for my bookmarking, which supports
making folder contents accessible via RSS. This is perfect for my use case: No authentication,
just fetch a feed and parse it. WordPress was born for this.

_Side note: I change bookmarking apps as often as I change email apps. I’ve used
Pocket, Instapaper, Raindrop, Evernote web clips, Notion, browser built-in options,
etc. I know one day I’m going to migrate everything to Pinboard and then it will
live there for the rest of my days. For now, I’m still using Larder._

I made another plugin very similar to the Feedbin one above, except that it fetches
and parses an RSS feed with WordPress’s built in [fetch_feed](https://developer.wordpress.org/reference/functions/fetch_feed/)
function. Like the other plugin, it fetches new posts once an hour and posts new
Likes, then saves the permalinks of the posts it processed to the database so it
skips those next time.

Since bookmarks can have a description, it optionally outputs a paragraph block 
after the Like with the description I created. Again it uses [Jan Boddez’s IndieBlocks plugin](https://wordpress.org/plugins/indieblocks/)
context block.

![](https://opengraph.githubassets.com/8ab94146c34671c8898b06a7dcab920f5c55c5cc2a646cdd769be60d1e4618f7/
cagrimmett/rss-to-indie-likes)

GitHub – cagrimmett/rss-to-indie-likes: WordPress plugin that takes posts from an
RSS feed and turns them into Indie Likes on your site.

WordPress plugin that takes posts from an RSS feed and turns them into Indie Likes
on your site. – GitHub – cagrimmett/rss-to-indie-likes: WordPress plugin that takes
posts from an RSS feed and turns them into Indie Likes on your site.

github.com

The main thing I learned working on this version is the default feed cache when 
you are using `fetch_feed()` in WordPress is 12 hours and you can override it with
a hook: `[wp_feed_cache_transient_lifetime](https://developer.wordpress.org/reference/hooks/wp_feed_cache_transient_lifetime/)`

Both have been running on my website for a couple weeks now without a hitch. I’ve
yet to link [Likes](https://cagrimmett.com/likes) and [Notes](https://cagrimmett.com/notes/)
in the nav or on the homepage because I want to redesign how they are output, but
I linked them here if you are interested.

## Comments

### By: Chris Lott

- Link: https://social.coop/@fncll/109734570217023659
- Published: 2023-01-22T14:44:19-05:00

[@cagrimmett](https://toot.cafe/@cagrimmett) Interesting! I wish there were a simpler,
packaged, “it just works” system for major apps. My last foray into POSSEing became
nightmare mish-mash to the point I gave up.

Loading...
