25 Days of omg.lol

Day 12

In sharp contrast to yesterday’s total lack of an update, tonight we have two really awesome new features.

Let’s dive in:

Weblog.lol API

The first version of the Weblog API is ready for testing. You can read up on it here, but the quick summary is that there are three endpoints:

They’re mostly stable, but have only been very lightly tested so far, so please report any issues.

OK, cool, but what fun is an API without something that uses it? Enter our second feature...

Weblog.lol GitHub Action

Last night, Dave Winer posted this:

I wholeheartedly agree. And so as far as weblog.lol is concerned, this new feature opens up an entire new world of editing possibilities thanks to the new API and GitHub Actions. You can use any editor you like (or at least any that integrates with git repositories, which includes many of them) and start using your own workflow for publishing your weblog posts.

☠️ First, a warning: This process introduces a new destructive process and must be used with extreme caution.

Hate to be so dramatic about this, but data loss is serious business. If you don’t already have a backup of your weblog posts, please make one now. You can generate an export right from the omg.lol weblog UI, so there’s no excuse not to have a backup on hand.

So, here’s the deal behind this feature: you can now set up a GitHub repo, store your posts there, and publish directly to weblog.lol through a GitHub Action. It works pretty well so far (but, again, and as with everything here — it’s extremely ultra alpha software).

The key gotcha here is that this is a one-way deal: when you run the GitHub Action, everything you have in weblog.lol is deleted and replaced with what you pushed to your repo. That’s really important to remember (and is the basis for the scary warning above). Also, consistent with the current one-way approach, any edits you make in the web UI after a repo push will not be synced with your repo, and will be overwritten with a subsequent repo push. Not great, I know, but we’re definitely at a “crawl” stage with this setup and the full bi-directional syncing is somewhere between “walk” and “run”. We’ll get there eventually!

Here are the steps to get started:

  1. First, create a new GitHub repo.

  2. Add the file .github/workflows/main.yml with this content in it:

on: [push]

jobs:
  weblog_import:
    runs-on: ubuntu-latest
    name: weblog.lol
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 2
      - id: weblog_import
        uses: neatnik/weblog.lol@v1
        env:
          ADDRESS: your-address-here
          WEBLOG_API_KEY: ${{ secrets.WEBLOG_API_KEY }}
  1. Change the your-address-here bit above to your own address.

  2. In your repo settings, click Secrets, and then Actions. Click New repository secret, and add the following:

  1. Add a folder to your repo called weblog.

  2. In the weblog folder, you can add all of your weblog pages and posts. But, just like with Gremlins (a classic holiday film), there are three rules you need to follow:

With eveything configured above, you can commit your stuff and push it into the repo. That will trigger the action, and then you can watch the action run. Click Actions at the top of your repo screen, then click on the running job, and then click on the weblog.lol job on the left under Jobs. Then expand the Run neatnik/weblog.lol@v1 item to see the status of the job.

This is all highly experimental, so please let me know if you run into any issues with any of it.

That’s all for now. As always, keep the bug reports flowing (GitHub issues are always helpful). See you again tomorrow, behind yet another door.

Adam