Tue 21 Feb 2017
10:59 AM

Microblogging with blot.im

Background

A month or so ago, I stumbled across Manton Reece’s Indie Microblogging Kickstarter campaign. It was new and cool and intriguing, because it fit well with something I’d been thinking about that Dave Winer wrote the year before, about not putting your content - your blog posts, your social media posts - into someone else’s silo. Which also comes with a nice kick on nostalgia for the way the web used to be, if I’m being honest: even when I was using Blogger in 1999, I was using their built-in FTP (how quaint, how novel!) to push it to my own servers, not hosting on Blogspot.

I’ve also been thinking about how this relates to Twitter. I’ve tweeted a lot - over 75,000 tweets at the time I wrote this - and if Twitter fails, which seems likely since they still don’t have a successful business model 11 years later and can’t seem to actually curb their rabid infestation of Nazis and trolls - all of that is, poof, gone. I can request an archive of my tweets, but then what am I going to do with that? It’s basically just the result of web-spidering Twitter. It’s not portable.

While thinking about these things, I ran across blot.im. I spent a few days poking around the site, watching their demo video, and considering what was going on. Blot does have a few things that made it seem pretty appealing to me:

So I took the plunge and signed up with Blot to host both a blog and a microblog in one spot, and I’ve been very happy at the level of tinkering I can get into, considering it’s something I’m not actually hosting. I then did some investigation to see whether it was possible to offer up a microblog RSS feed on Blot. The actual microblogging itself was not an issue - after all, it’s just a title-less post, and in my case, one of 140 characters or less because I’m farming them out to Twitter with IFTTT (speaking of companies without a business model, heh). This would also set me up to syndicate to Micro.blog when it’s ready.

Caveat

This post will not cover styling your blog to display microblog posts inline (or not). Hopefully you can take a look at the Mustache template for the microblog RSS and figure out how to apply that to your blog (or not) as well. I actually like the inline mixing of regular posts and titleless posts, ever since I saw it on Manton’s blog.

I’m also assuming that you’re using Blot, since this is a tutorial on microblogging with Blot, and that you have a custom template. If you don’t, you’ll need one - go ahead and create one based on whatever you’re using, since this involves fairly minimal changes.

With that out of the way, let’s get to the how-to.

Time to get your hands dirty

1. Create new view

In the template editing view on Blot, click + Create view.” Name it whatever you want; I called mine microblog.xml.

2. Copy the regular RSS view into the microblog RSS view.

Using the default or Mira themes (the only ones I have experience with so far), the RSS feed’s template on Blot is stored in the feed.xml view. Open this up, highlight all the text, open microblog.xml, paste it in, and save. microblog.xml is now a copy of feed.xml.

3. Add the tags that will allow you to filter for microblog posts.

Inside your microblog.xml view, you will see a tag that looks like this:

{{#recentEntries}}

And further down, a second tag that looks like this:

{{/recentEntries}}

We’re going to add a pair of lines that tell our template we only want to include microblog posts. Below {{#recentEntries}}, add {{#metadata.microblog}}, so that it looks like this in your template:

{{#recentEntries}}
{{#metadata.microblog}}

And above {{/recentEntries}}, add the equivalent closing tag {{/metadata.microblog}}, so it looks like this:

{{/metadata.microblog}}
{{/recentEntries}}

If you want to see a sample, here is my microblog.xml template.

4. Optional: Filter microblog posts from your regular RSS feed.

It’s up to you whether or not you want to weed out microblog posts from your RSS feed. In my case, I’m definitely doing some filter - I still intend the regular RSS feed to syndicate to other sites differently than the microblog feed, so I don’t want microblog post showing up in the same endpoint twice in two different formats. So in that case, you’re going to repeat what we just did above to the microblog.xml template, except:

  1. The changes will be made to feed.xml, and
  2. Instead of {{#metadata.microblog}}, you will use {{^metadata.microblog}}. The closing tag, {{/metadata.microblog}}, remains the same.

Again, if you want to see a completed example, here’s my feed.xml template.

5. Add a route to your microblog view so that it’s accessible on the web

Click on the microblog.xml view to edit it, then click Settings at the top of the page. Add a route to the page - this is what you’ll make a link to so that someone can get to your microblog RSS feed. Mine’s /microblog.rss - it should look something like this when you’re done.

microblog route demonstration

Save your changes.

Your regular RSS feed is in your site’s menu - your microblog RSS feed should be too, if you want people to be able to directly subscribe to it. Maybe you don’t! In which case, skip this step.

You’re done editing your template, so click < Back to dashboard,” then Settings,” then the Menu” tab. Add a new menu entry. The first textbox is for the link text (mine reads Microblog RSS because I am creative), the second is for the URL and should match the route you just added to the microblog view in step 5. It should look something like this:

microblog link demonstration

Save your changes.

7. Write a microblog post

What I have left out of this so far is exactly how you’re going to differentiate your microblog posts from your regular posts. We’re going to use a feature of Blot which allows for custom metadata for your posts. Open up a blank text file. On the first line, write this:

Microblog: yes

Honestly, it doesn’t matter what you put after Microblog: - you can write Microblog: antipasto for all that I or your new RSS feed care. It’s just checking to make sure that this custom metadata is there at all.

Now, hit enter twice to add two newlines, then write your microblog post. Here’s a sample. Save it in your Blot folder with the rest of your posts. You should see it show up on your site pretty soon, but what’s important is that you should see it in your microblog RSS feed (but you shouldn’t see your other posts in there), and if you filtered microblog posts out of your main RSS feed, you shouldn’t see it in there.

That’s it! You now have a working microblog feed on your Blot.im blog.

Hold up, are you some kind of wizard?

Not quite. Technical explanation follows. Look back to when we add this part to our microblog.xml template:

{{#recentEntries}}
{{#metadata.microblog}}
...
{{/metadata.microblog}}
{{/recentEntries}}

What that says to Mustache, the templating engine that Blot uses, is

  1. Fetch all the recent entries, and then
  2. Only do the stuff in between these tags for recent entries that have a metadata tag called microblog’.

And how about filtering it out of our regular RSS feed?

{{#recentEntries}}
{{^metadata.microblog}}
...
{{/metadata.microblog}}
{{/recentEntries}}

The caret (^) is Mustache’s negative tag, so that in essence says:

  1. Fetch all the recent entires, and then
  2. Only do the stuff in between these tags for recent entires that don’t have a metadata tag called microblog’.

You may have figured out by now that you could call that custom metadata tag anything you want, as long as it is present on microblog posts and not present on regular posts. You can call it Jeff. Jeff’s a nice name. Then your microblog.xml template looks like this instead:

{{#recentEntries}}
{{#metadata.Jeff}}
...
{{/metadata.Jeff}}
{{/recentEntries}}

Your regular RSS feed looks like this:

{{#recentEntries}}
{{^metadata.Jeff}}
...
{{/metadata.Jeff}}
{{/recentEntries}}

And your microblog posts look like this in text form:

Jeff: yes

Maybe making my metadata tag "Jeff" was a weird decision, in retrospect.

But hey - it’s your blog. You do what you want. :)