Excursions avatar

Dev

Getting Post URL in Drummer

I enjoy writing posts in Drummer. One of the many reasons for that is I can see all my posts in the same editing space. It is so easy to scroll through all your posts and find reference to just that one old post.

One thing that missing, though, was there was no easy way to get the url for that post right in Drummer. So, I got scripting. I have created a script which does just that. Select any node, run the script, and it will present the URL for that post in a dialog box. Here’s how you enable it.

  • Copy the below Drummer script and paste it in your special opml file for Scripts menu (File ⇾ Special files ⇾ Scripts menu…)
  • You will see a new entry in Scripts menu
  • Select any node, even the headline (a titled post), and select the newly added script menu item

You will get the URL for the selected node.

Get Post URL
	var created = op.attributes.getOne("created");
	var baseurl = opml.getHeaders().urlBlogWebsite;
	if(typeof(baseurl) == "undefined"){
		baseurl = "http://oldschool.scripting.com/" + opml.getHeaders().ownerTwitterScreenName + "/";
	}
	var dt = new Date(created)
	var day = (dt.getUTCDate() < 10 ? '0' : '') + dt.getUTCDate();
	var month = ((dt.getUTCMonth() +1) < 10 ? '0' : '') + (dt.getUTCMonth() + 1);
	var year = dt.getUTCFullYear();
	var hour = (dt.getUTCHours() < 10 ? '0' : '') + dt.getUTCHours(); 
	var minutes = (dt.getUTCMinutes() < 10 ? '0' : '') + dt.getUTCMinutes()
	var seconds = (dt.getUTCSeconds() < 10 ? '0' : '') + dt.getUTCSeconds()
	var post = opml.parse(op.getCursorOpml());
	var isTitledPost = typeof(post.opml.body.subs[0].subs) != "undefined";
	var postUrl = "";
	if(isTitledPost) {
		postUrl = baseurl + year + "/" + month + "/" + day + "/" +  hour + minutes + seconds + ".html";
		postUrl = postUrl + "?title=" + op.getLineText();
	} else 
	{
		postUrl = baseurl + year + "/" + month + "/" + day + ".html#a" +  hour + minutes + seconds;
	}
	dialog.ask("This is the URL for the selected post:",  postUrl);

Getting Started Blogging with Drummer

I recently started blogging with Drummer, a new Outliner made public by Dave Winer. It has been a wonderful experience. I don’t know what it is about a single outline as a base for your blog, but it feels natural. I have been enjoying writing and playing around with my Drummer blog. However, it is not easy to fathom the simplicity of the whole system just through words — only trying it out will make you appreciate the ease. I wanted to capture what it is and how to quickly get started with it for myself and others to follow.

Drummer documentation captures most of this information. But for someone, like me, who’s new to the concept of outliner, the whole stuff can be pretty overwhelming. So, here I capture what I learned and liked so that it helps other newbies like me.

What’s an Outliner?

An outliner is basically an editor that can edit an outline. What is an outline, you ask? Well, outline is text items represented in a hierarchy, with each item having a parent (typically a title) or multiple sub-items (typically related points). There’s a lot more to know, but I am more focused on drawing a parallel with regular blogging terminologies.

You can think of a first parent item as a title of your post. Each sub-item that follows is like a new paragraph. You can further divide the items into sub-items, that’s grouping related points into a subtitle for example. The only difference is instead of it being represented as a header and list of paragraphs, it is a tree-structure of points, closely related and unrelated.

If a post doesn’t have any child, it’s a titleless post, a micro-post — something like a tweet.

Dave Winer is the strongest proponent of using the outlines as the base for the blogs, he uses them for his blog, Scripting News. The basic hierarchical structure of an outline, makes using outliner for blogging powerful. Both the types of posts, long-form and micro, sit well together. After all, it’s just one long list of text items one after another. Whether they have a sub-item or not define how they get represented. Or that’s how Dave likes them represented.

Drummer is one such outliner that benefits from the years of Dave’s experience. He has understood all the nitty-gritty of blogging through this form. So, once you overcome the initial struggle of unknown, the experience is pretty smooth.

Is it a Blogging CMS?

Not really, Drummer is just a web application that can edit outlines. These outlines are typically represented as an OPML file. Basically, all you do with Drummer is edit OPML files of different forms. It wraps a few special OPML files — mainly blog.opml — to give them specific meaning while using them as base for blogging.

But, all we do is edit these OPML files then, what builds the blog?

Well, the software that runs Dave’s blog does that job. It is called Old School (because Dave believes this is the old school way of blogging) and is hosted by Dave. In a way, Old School is the blogging CMS and not Drummer.

So, from my understanding, the way the thing connect is as below.

  1. You sign in with your Twitter account and that creates the necessary backend — basically a S3 store for your OPML files — based on your Twitter username.
  2. You create, view, edit the OPML files using Drummer. The special files like blog.opml and about.opml hold special meaning for Old School. (Update: In fact, about.opml is just used for representation. You can name it anything.) So, you update them and through a command in Drummer (Build my blog), you communicate to Old School server to refresh your blog.
  3. Old School receives the communication and based on provided inputs, it identifies the files to use for building the blog. It reads the OPML files from the backend store for the files and converts them to static files that get served as your blog.
  4. Old School also serves you blog at the http://oldschool.scripting.com/<your-user-name> URL. So in a way, you don’t need to host any additional software.

In a way, then, Drummer and Old School together act as your blogging engine. Drummer is your editor where you write your posts. Old School acts as a CMS to build and serve your blog.

How do I get started?

Dave has a got a handy documentation in place that you can follow. I will point to the relevant parts in the documentation so that you can follow along and get started.

  1. Main blog: Follow the getting started guide to get a blog up and running with Drummer. In short, create a blog.opml outline file. Make the outline public. And finally, build the blog using Tools > Build my blog.... This should open a new tab with your blog rendered with Old School. You can customise your title and description of your blog and a few head-level attributes.
  2. Title and Description: Modify/add the head-level attributes title and description and rebuild your blog.
  3. Header Image: Add a head-level attribute urlHeaderImage pointing to the header image of your choice and rebuild your blog.
  4. Copyright: Add a head-level attribute copyright with the text you want to appear in the footer and rebuild your blog.
  5. About Page: If you want to create a new tab in your blog for your About page, create a new about.opml outline file using Drummer, make the outline public, add a head-level attribute urlAboutOpml pointing to this public outline and build your blog again. (Update: In fact, about.opml is just used for representation. You can name it anything, as long as you configure the value for urlAboutOpml accordingly.)
  6. Link Blog: If the concept of linkblog excites you, you can use another software by Dave, Radio3. Just add a new head-level attribute urlLinkblogJson pointing to your linkblog JSON file, which would look something like http://radio3.io/users/<your-user-name>/linkblog.json.
  7. TimeZone: To make sure the dates are rendered correctly on your blog, add a head-level attribute timeZoneOffset for the place where you would be blogging from. The value should be the offset from UTC — for example, +5:30 for India or -4 for New York.
  8. Creating Post: Head over to your blog.opml file in Drummer and click on the + icon (for New Note), write what you want to write and rebuild your blog. Your post should be up.
  9. Adding Links: Select the text to which you want to add a link, click on the “Link” icon (the second icon from top in the icon bar that sits on the left of the editing area) and insert the URL.
  10. Adding Images: This one’s slightly tricky. First, have your image hosted on some place where it would be accessible publicly. Get the URL to your image. While on the item you want to associate the image with, click on the “Edit attributes” icon (the third icon from top in the icon bar that sits on the left of the editing area). Now you can either create an inline image (with attribute inlineImage), right-margin image (with attribute image), title image (with attribute metaImage). I wish this work was simpler.

At this point, you should have a well-configured blog up and running. Keep Drummer interface open in tab and keep adding entries. This method of updating your blog will soon grow on you.

What else can I customise?

Even though you have all the basics covered till now, there is still a lot that you can and should do. But I would recommend get comfortable working Drummer and check for yourself if the workflow fits your routine and liking. If it doesn’t, these additional configurations are just a distraction.

Anyway, if you find out that you are enjoying this system of blogging, here are links to a few additional configurations that you can perform.

A Few Additional Notes

  1. There’s a Mac app (electron based) called Electric Drummer that can act as an outliner. However, you should avoid using it for blogging if you intend to blog from multiple systems. Changes made through the app can overwrite ones as done on the web Drummer. So thread carefully.
  2. Drummer is evolving. Dave is working hard to make sure all serious reported issues are resolved. Early adopters are trying out a hundred things independently. If that sounds fun, the Drummer support issues page is the place to go.
  3. You can stay-to-date with all things Drummer by following this official blog.
  4. How does Drummer cost zero? Dave answers.
  5. Why is Drummer, and other software from Dave, so tightly coupled with Twitter? Dave answers.

I intend to use Drummer as a place where I form my thoughts over the time. The ease of the updating process makes posting unformed thoughts a breeze. So, in a way, this space represents the most raw me. You can follow this me as he experiments with my Drummer blog. And of course, there’s an RSS feed.

Finally, I have completed a pretty tricky exercise that I had started about a couple of weeks back. It wasn't tricky because I wanted to move my website to a different platform. It was tricky because I wanted to do it cleanly. I wanted to retain as many things that worked well for me as I could. I didn't want to break much that was core.

So, after days of experiments and trial runs, and notes and list of reviewed to-dos, I've managed to switch to WordPress. I will note down why someday - one short, but big reason though is editing. I am tired of working custom solutions with Blot -- it's a great service, no doubt. But you need to love your files a lot. I am currently not in that phase.

Anyway, as intended, the core is retained. The links are (hopefully 🤞) not broken. #IndieWeb support was a must, have stitched that in. The option to switch to a dark theme was a must. A simple reading experience was a must. I've managed to get good writing experience too. So, times now to sit back and relax.

Do let me know if see anything that's not working well. I won't mind if you also let me know if everything's working fine.

I have been working with David Merfield on a little side project. The idea started simple - what if there was a simple posting interface for Blot? In extension, something that one can use to write and publish a post to Dropbox. Blot is simple as-is for writing and posting (it’s all files). But there are times when I do want to quickly post from my web browser. And for such times, I still need a simple writing interface.

That thought was enough to interest both me and David. We got to work. The project got neglected in between. And then was picked up again. And I think, it is in a state now where it can really be useful to a few. I can attest to that because I, myself, have been using it for few days now.

Here’s Wall — a web-accessible text-editor over Dropbox, works nicely with Blot.

I believe this would be useful for many. It is clean. It is light, pure-client side application. It supports local drafts. It can export markdown. It can publish to Blot. Perfect for all those text posts.

I have my own fork of the project where I want to use the editor and support publishing to multiple places. To start with, I have extended it to post it anywhere in Dropbox.

I have hosted it here as Scribe. I plan to extend it next to be used as a micropub client. Still in works, though.

Of course, this is not perfect yet. For one, it does not work well on smaller screens. But it is a good enough. Do give it try.

Over the last week, I’ve added some features to Blotpub that were long in works - support for syndicating longer posts, support for updating posts. I’ve also automated sending of webmentions to the target sites for reply and like posts types. It’s been some productive week this.

I am having fun getting back into Indieweb stuff — working on adding support for updates to Blotpub. This has been in works for so long, I had to get to it. I also recently added support for syndicating longer posts to Twitter and Mastodon. Always makes me relaxed.

A quick question for the IndieWeb community here, how do you send the webmentions? Is it automated on posting? Is it part of the micropub or an independent script? Are there ready resources, scripts or tools available? I couldn’t find much on indieweb.org.

I have completed the consolidation exercise that I had planned to carry out this weekend. All the posts exist on the home page of the root domain now and is hosted by Blot. There are no sub-domains for separate posts. There is no landing page. It’s all words.

Of course, I had butterflies in my stomach before I began the whole exercise. I had posts spread across different categories. I had very specific styling done for some rarely used components of the blog posts. And I had pages.

Then I had some complex pages and posts. It was the thought of migrating this varied content that made me a bit edgy. Posts like this guide on moving to Hugo. Or this one about displaying webmentions along with posts. I had to manually migrate such posts along with the necessary styles.

I am happy overall with what I have achieved. Things are simpler now. If I have to post something, I know where it would be. Doesn’t matter what the nature of the post is. This space now supports all types. Along with the /now page reseted to begin from now.

What this also means that I have to bear with few things. I have lost webmentions to the blog sub-domain posts. I have to reset my indieweb presence, clear all caches with indieauth sites. Thankfully, not much was broken that couldn’t be fixed simple re-logins and re-configurations. I (and you) have to bear with the configured redirects to propagate through the Internet and reach all. So the old links will stay unreachable till that happens.

I have kept the Hugo site alive. It hosts the archive, something I did not want to carry along. I just restyled it to make it resemble a timeline leading back into the time. I do not wish to ever post to it again. Simplicity of maintaining and updating my website with Blot has won me over.

When you have a mind not too clogged with some insignificant thoughts, one can get things done. I managed to add support for syndicating posts to Twitter from Blotpub. A minor update, sure. But an update nonetheless after a long time. Good to have the focus back.

I realized today that it was on this day a year back that I had opened Micro.threads to all. It was the first project built ground up that I had made available for every one to use. The earlier projects were either customized or personal. It has been a wonderful learning experience.

It was also an opportunity for myself to gain confidence. It kick-started my journey to more hobby projects, inspired me to even write more. Funny how few small beginnings can turn into significant projects.