2014-04-05

Dropbox Synced Blog

Updating a Gobble blog is now much faster due to the addition of the fsnotify library. The library watches a blog’s “posts” directory and, when anything changes, causes Gobble to refresh its post and comment cache. New posts, edits and deletions now occur instantly. The old 10 minute wait for the timer to expire has gone.

In related news, the content of Simian Zombie now gets synced to the server by Dropbox. The old workflow looked like this:

  • Write a post;
  • Commit to Git;
  • Push to BitBucket;
  • Connect to server;
  • Pull from BitBucket;
  • Restart Gobble to force a refresh.

The new workflow looks like this, thanks to fsnotify and Dropbox:

  • Write a post.

Much nicer. I can even edit posts on my phone without having to use SSH and Vim.

I had a few false starts. The initial idea was to use BitTorrent Sync, not Dropbox, as I thought it would be easier to set up. Unfortunately, the documentation for CLI-only installs is half-baked and, after an hour or so of tinkering, I switched to Dropbox instead. Dropbox had its own share of issues, the most annoying of which was a segfault at startup in the current version. Switching to the latest beta fixed that.

2012-09-11

Blogging Engines

I’ve been looking for a replacement for BitBlogger. It’s a neat little blogging system, but it has two problems:

  • AppHarbor applications get shut down after 10 minutes of inactivity;
  • It’s written in C#.

The first issue means that my BitBlogger site usually takes far too long to respond. BitBlogger is designed to use the cache exclusively to store all of its content. BitBucket notifies it of any data changes, at which point it sucks the latest version of the blogpost repository into the cache. This works well if the cache doesn’t get wiped, but every time the app gets killed the cache goes too. The application has to rebuild the cache by reloading everything from BitBucket when it gets restarted, which takes time.

I designed BitBlogger in this way to avoid spending a fortune on AppHarbor’s data storage plans, but I didn’t know about the shut down policy until later.

As for the second issue, using C# means I have to maintain a Windows virtual machine, an installation of VMWare Fusion and a copy of Visual Studio. That’s far too much overhead for something that could be written in a few hundred lines of Go and deployed on any cheap Linux server.

With hindsight, having a blog that is stored in Mercurial and gets deployed on each commit isn’t as useful as I’d hoped. There’s no way to write a post on an iPhone, for example. Something I’ve been considering lately is using DropBox for storage instead, and it seems that a few other people have had the same idea:

My favourite implementation so far is Scriptogram. Getting a blog set up is completely painless. Creating a post is as easy as writing a Markdown file in a specific DropBox folder, and syncing them just involves clicking a button on the Scriptogram website.

Scriptogram was so frictionless that I seriously considered moving this blog - I even wrote a WordPress to Scriptogram converter - until I realised that Scriptogram doesn’t have a comment system. I could add Disqus to the theme files, but I find that the comments are the best part of this blog and I don’t want to outsource their storage. It looks like we’re keeping WordPress.