3 min read

Intriguing Stuff

I added a section on my Journal today dedicated to intriguing stuff.

Think of it as a handpicked collection of links I have recently bookmarked.1 If you use a feed reader you can subscribe to it here.

Some of my favorite online content is a compilation of curated links with concise commentaries. Waxy, Daring Fireball and Kottke maintain my favorite examples.

If you're curious about the technical aspects, continue reading for more details.


Process for Publishing Bookmarks

I wanted a streamlined process to post interesting links on my Ghost blog, tailored to my bookmarking routine. I use the read-it-later service Omnivore to save links. Omnivore offers extensions compatible with all the browsers and platforms I use, making it an excellent choice for me to rapidly add links I am bookmarking to my blog.

When I add a bookmark in Omnivore, which includes an annotation (eg note) and a custom label (eg tag), it automatically gets posted to my blog and appears on a dedicated links page.

Integrating Omnivore with My Ghost Blog

Omnivore offers an API and supports Webhooks. So, I wrote a Cloud Function that's hosted for free on Google Cloud that integrates them.

When a new bookmark is added, the Omnivore webhook triggers the cloud function. The function retrieves extra details about the bookmark from the GraphQL Omnivore API, converts the content into HTML, and posts it to my blog via the Ghost Admin API.

When the function posts the link on my blog it sets the original bookmark's URL as the canonical URL for each post, ensuring that the RSS feed directs the reader to the original, external link instead of the post I added on my blog.

Displaying the Data on My Ghost Blog

To display the content on my blog at danielraffel.me/links, I updated the routes.yaml file. This routing links to the RSS feed and establishes the collection where the /links page will live.

I created links.hbs to rollup all the posts tagged with links on Ghost. I used JavaScript to group posts by the reverse, chronological date they were saved to Omnivore and to format the links in a style similar to Daring Fireball, where the post title leads to the external site.

Since I wanted the /links page to include metadata linking to a custom RSS feed, so someone could copy/paste the URL to their feed reader and subscribe just to the links, I had to come up with a novel solution which required some workarounds that I'm not happy about.2 Hopefully, I'll discover better ways to do this in the future.

OmnivoreToGhostSync on GitHub

Most of the effort was in configuring the cloud function to process links from Omnivore and post them appropriately to Ghost. I've shared the code on GitHub for others who might find it useful.

GitHub - danielraffel/omnivoreToGhostSync
Contribute to danielraffel/omnivoreToGhostSync development by creating an account on GitHub.

  1. I think OGs call this a linklog.
  2. Cathy Sarisky on the Ghost Forum was incredibly helpful at answering questions I had to get my implementation working.