Why I wrote my own CMS so I could write a novel in a month

November 2, 2012 | 8 comments

Growing up, I always wanted to be a professional writer. It’s still something I aspire to, but I get just as many creative kicks out of building software – and the pleasure is even greater when, just occasionally, I get to combine the two.

I’ve tried to participate in NaNoWriMo, the National Novel Writing Month, before. Usually, I flake out. To have “won” NaNoWriMo means that you’ve written a complete novel of over 50,000 words over the course of the 30 days of November, and most of the time I stall at 3,000 or less. I’m ashamed to admit that part of my inability to complete any kind of long-form content is my dependence on the Internet: I’m so used to tweeting and getting feedback that the thought of getting to 50,000 words without anyone seeing it is daunting. (There’s a whole other piece to be written about this – I’ll get there another time.)

So, I decided that this year I’d try it again, but I’d publish publicly as I went. It’s an exercise in perseverance more than anything else, so I’ve tricked myself into thinking that this is okay. So here it is – but I’ve chosen to write it a homegrown CMS rather than using Word or WordPress. I wanted to prominently see the word count as I typed, to track my progress towards 50,000 words. And I didn’t want to deal with the increasingly-complicated WordPress interface (which I gladly use for this blog) or be tied to a single computer in the way I would be with Word. I also wanted to play around with some little bits of flair that would be hard with an existing piece of software.

So, I spent an hour or two the other night putting something together.

(My Writemo editor, above, vs WordPress’s editor, below.)

The CMS is a series of PHP scripts sitting on a single-table MySQL back-end. I’ve split the novel up into segments, which are effectively posts. That makes it easy for me to edit small chunks of the novel at once, rather than having to open the whole thing up each time. It also allows me to syndicate the novel in an RSS feed, and give people the choice to read it novel-style, with the segments in ascending order, or blog-style, with the newest segment at the top.

There are no images. I set the background to #eeeeee, the text color to #333333, and the font to Kameron from the Google Web Fonts collection. The editor is a simple textarea control, but in order to ensure I can use tabs, I use the following jQuery (which I found on StackOverflow, although I’ve now lost the source page):

$('#maintext').keypress(function (e) {
    if (e.keyCode == 9) {
        var myValue = "\t";
        var startPos = this.selectionStart;
        var endPos = this.selectionEnd;
        var scrollTop = this.scrollTop;
        this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos,this.value.length);
        this.focus();
        this.selectionStart = startPos + myValue.length;
        this.selectionEnd = startPos + myValue.length;
        this.scrollTop = scrollTop;

        e.preventDefault();
    }
});

I also count the number of words in the textarea with each keypress, and display both the number of words in the current segment, but also the number of words across the whole project (top and bottom numbers respectively in the screenshot). For this, I used C. Bavota’s jQuery word count plugin as a starting point, and pared it down into something simple enough for my needs.

Because I didn’t want to mess with wysiwyg editing, I chose to use markdown notation in the editor. That way, I can italicize a passage by using _underscores on either side of it_, for example. It’s very intuitive, particularly if you’ve ever edited anything on Wikipedia or in Mediawiki. And Michel Fortin’s PHP Markdown project is extremely simple to use: you simply wrap your string with the Markdown($string) function in order to turn it into perfectly serviceable HTML. The only niggle is that I noticed it doesn’t handle single line-breaks very well, so I deliberately double-space my text before I convert it from markdown.

And that’s it; the editor itself is deliberately designed to be extremely simple, and (if I push Firefox to full-screen mode) feels like a low-rent iA Writer or other distraction-free writing utility. I can edit from anywhere, on anything that supports standard HTML, and my pages are extremely low-impact. And most importantly, I’m getting the words out.

Anyone else rolling their own software for this kind of thing? I’d love to compare notes.

Why I think Marissa Mayer should buy Automattic

September 12, 2012 | 9 comments

WordPressPandoDaily reports that Yahoo! has sold half its stake in Alibaba for $4.5 billion. Their take is that Yahoo! needs one or two big products to turn the company around, and that Marissa Mayer should look to successful large acquisitions like PayPal and YouTube.

I agree. And I can’t think of a better company for them to buy than Automattic, the company behind WordPress.

For every 100 new domains names in the US, 22 of them run WordPress. Around 10% of all websites in the world run WordPress. Those are two amazing statistics.

Automattic’s CEO, Toni Schneider, worked at Yahoo!, and actually created the Yahoo! Developer Network. Meanwhile, the open source WordPress now contains Jetpack, a tool that links each disparate installation to the WordPress.com hub.

Automattic makes around $45m a year, with a valuation of $300-500m. Yahoo! can afford that, with or without the Alibaba transaction.

What would it get, beyond a connection with the platform powering between 10-20% of the web? Well, let’s think about Yahoo!’s origins: a curated index of the web. Not algorithmic search, but edited channels that were the best of the web for any particular topic.

In the mid-2000s, Yahoo! acquired Flickr and Delicious. It no longer has the latter, but it’s started hiring again for the former. Flickr’s a great way to find photos of things or collections of things. (And of course, Delicious was too.)

Yahoo! also has a pretty cool set of semantic API technologies under its belt, for extracting meaning from free text, for example.

By curating content from blogs, Flickr, its Hollywood connections, plus integrating with its APIs and content-specific grouping and filtering tech, it has the potential to be how we find new content online. (Google, of course, is how we find specific content that we know we need, Facebook is how we keep in touch with our friends, and Bing is trying to be Google.)

Is Yahoo! a technology or a media company? It could be neither: a platform company, in the truest sense of the word. It can provide a platform for content creators to find an audience, and for audiences to find interesting content. That’s still, really, missing in 2012.

Going back to WordPress, what if Yahoo! integrated its own ad platform with WordPress, allowing bloggers to make money from their content quickly and easily, while simultaneously finding an audience through curated topical channels? What if it then acquired the OpenPhoto Project (run by another Yahoo! alumnus) and pulled the same trick there, integrating those photos with Flickr and allowing photo owners to pull the Flickr trick of allowing licensing through Getty? Rinse and repeat for video and other partnerships.

Yahoo! could embrace the distributed, creative anarchy of the web while at the same time consolidating an ad presence, declaring once and for all what it actually does, and – I would argue – positioning itself to take over from other, declining media models.

WordPress, meanwhile, would gain from Yahoo!’s resources, assuming the Automattic team and the WordPress open source community retained control. And an unconstrained Matt Mullenweg would make both companies fly.

Open source needs designers

June 27, 2011 | 20 comments

Design is Not My Job 1It’s been a slow progression. First, I moved from Eclipse, for years my Integrated Development Environment of choice, to NetBeans, which I’ve been using for the last year or so. It’s faster, leaner, and less prone to bringing down my computer for no readily apparent reason. But now, slowly, I’m making my way to Coda. And it’s like a breath of fresh air. It just works.

It surely helps that Coda is a native code web development IDE, while the other two are optimized for (and built on) Java. For large applications, Java is a dog. But there’s something more to it: while NetBeans and Eclipse feel engineered, Coda feels designed. As well as checking that everything works, someone went through the trouble of checking how it feels to use. The emotional experience was an important part of the design.

Beyond programming languages and development methodologies, the most important skill a developer can have is empathy. To be useful, software needs to be built with a deep understanding of my needs as a user, which may be different to another user’s needs. I write both software and short stories, and I use the same approach for both: I’m writing for an audience. Open source often feels like it’s scratching an itch; rather than users, the software is often written for the developer. We know that over 80% of Linux kernel contributions are made by corporations, so it’s reasonable to infer that most open source software is built to feel an internal corporate need.

Consequently, interaction design is underrepresented in open source. Versions 0.1 through 0.9 of Elgg featured interfaces built by Dave Tosh and myself, reacting to reports of what users found difficult or confusing. They were usable, but although I’m proud of them, they were undeniably clunky. From version 1.0, we had Pete Harris on board, an actual UX designer, who made a world of difference to the project. I don’t think Elgg would be as popular as it is without him. (Now that he’s moved on – alongside the rest of the 1.0 core team – I’m interested to see how the interface develops.)

Open source is an important, valid methodology with many applications. I still completely stand behind it, but I’m not willing to use inferior software for ideology’s sake. So how can we improve the design ethic in open source?

Part of the problem is market. To be blunt, commercial software needs to sell, and usable interfaces are an integral part of that; open source projects don’t, and often sell support as a funding strategy. Making the software easier isn’t, therefore, always part of the dynamic. (You’ll notice that the best-designed open source projects - WordPress, StatusNet et al – all have a commercial version.) It’s also not necessarily part of the engineer’s agenda: I’ve too often heard software developers discuss design as a kind of fluffy afterthought that they don’t view as being as important. I try not to hire developers with this mindset; anyone who thinks they’re more important than anyone else in the development process is destructive.

Another problem, though, is designer attitude. Who wants to give away their hard work for free, after all? Designers already complain about their work being undervalued on marketplaces like 99designs. (Oddly, very few developers complain about their profession being undervalued on sites like oDesk, although I think it is.) While developers see having a Github repository as a kind of portfolio, and participation in an open source project as career-building, designers don’t have the same incentives. Although there are individual examples – Chris Messina’s involvement in Firefox undoubtedly boosted his career, for example – a designer’s participation in an open source community is not generally seen as being awesome. Yet.

Open source companies have an incentive here, and a responsibility to the community to promote this ethos. They should understand the importance of hiring designers, and they should give preference to designers who have contributed to open source projects. Most importantly, developers should understand that designers are engineers too: they just work with a different set of tools.

Illustration: Design Is Not My Job 1, by Andy Mangold, released under a Creative Commons license.

Keeping the web decentralized

November 20, 2010 | 2 comments

3Com Campus in Massachusetts: 1999Tim Berners-Lee has an article in December’s Scientific American about the future of the web. It serves, in many ways, as a list of baselines – things that should be obvious to anyone who’s worked with the web for any real length of time. He argues for net neutrality, for open standards, and for the decentralization of web-based functionality; all things that I agree must be fundamental to the platform if it is to have a healthy future. It’s required reading, and worth sending to all your non-technical friends who use websites as part of their lives.

Decentralization is another important design feature. You do not have to get approval from any central authority to add a page or make a link. All you have to do is use three simple, standard protocols: write a page in the HTML (hypertext markup language) format, name it with the URI naming convention, and serve it up on the Internet using HTTP (hypertext transfer protocol). Decentralization has made widespread innovation possible and will continue to do so in the future.

[…] Several threats to the Web’s universality have arisen recently. Cable television companies that sell Internet connectivity are considering whether to limit their Internet users to downloading only the company’s mix of entertainment. Social-networking sites present a different kind of problem. Facebook, LinkedIn, Friendster and others typically provide value by capturing information as you enter it: your birthday, your e-mail address, your likes, and links indicating who is friends with whom and who is in which photograph. The sites assemble these bits of data into brilliant databases and reuse the information to provide value-added service—but only within their sites. Once you enter your data into one of these services, you cannot easily use them on another site. Each site is a silo, walled off from the others. Yes, your site’s pages are on the Web, but your data are not. You can access a Web page about a list of people you have created in one site, but you cannot send that list, or items from it, to another site.

The full article is over here.

I’m waiting for an application layer to emerge that embodies these traits (here are some ideas about how to make it a reality), but funnily enough, most web companies don’t seem to like the idea of letting go of their proprietary databases and competing on features rather than lock-in. Of course, the likes of Status.net and Diaspora are making a go of it, but in both cases, the applications create communities in themselves (which are interoperable with other communities) rather than single, WordPress-style nodes with social hooks that sit directly on the web.

In some ways, these applications aren’t directly social at all – certainly not in the “social networking” sense. There don’t have to be profiles, friends lists, or even direct sharing. They might be social in the sense that they are web applications – by definition, applications that are connected to the web (and therefore the billions of people who now use it). They provide notifications to their operators, allow access to content to be controlled according to a standard access control list, and allow that content to be commented on and relinked elsewhere. The “decentralized social web” is really just an evolved form of the standard publish-and-read model we’ve been using with blogs for over a decade, combined with the linked data concepts Berners-Lee champions.

So when do we get to use it? Well, to be honest with you, it’s kind of irritating. This is one of those inventions that are discovered rather than created as such: I have a complete picture of how this software would work in practice, and I understand how to create a business model that would render the software both widely attractive and financially sustainable. At some point I’ll give up on waiting for it to magically emerge and set to work – right now there is no competition (aside from other, different communication models), and a bunch of real-world problems that it would solve.

What kind of problems? Here’s a hint. Stop thinking in terms of publishing on the web, and start thinking in terms of distributed communications, and distributed, open markets. (Not just markets of ideas, but also tangible business markets.) Stop thinking about software and data, and start thinking about empowering people who are striving to bypass the gatekeepers in their way and connect, directly, with each other. Stop trying to own peoples’ lives, experience, skills and information, and put them in full control to let them talk, share, create and do business with each other.

Photo of Tim Berners-Lee by Jim Grisanzio, released under a Creative Commons license.

Next Page »