The Twelescreen code

In my previous post I wrote about the inspiration for Twelescreen — wanting to create an overbearing, Big Brother-style screen for displaying Tweets by the government and security forces. As a result I’ve also made a self-hosted, easily customisable, themeable, one-Tweet-at-a-time, full-screen, web-based Twitter client.

FBI Most Wanted: Bradley Carter is wanted for his alleged participation in several 'smash-and-grab' robberies in the DC Metro Area

Initially this whole thing was a hasty single-word joke. But I soon decided I wanted to make the code more re-usable, a decision that multiplied development time quite a bit. I started fiddling with it five months ago and it’s eaten up a lot of my free time since.

The result is the code on GitHub which is flexible enough to create a similar big-screen Twitter experience for much less scary or satirical uses. Assuming you can get a Node.js application up and running which I appreciate is, statistically, very unlikely.

But still, once over that hurdle, there is plenty that can be customised without altering any of the code. From the extensive README comes this list of features:

  • Many categories of Twitter accounts can be created. Each category has its own URL.
  • Each category can be included on the top-level menu, or omitted.
  • New themes can be made with CSS and, optionally, HTML templates.
  • Themes can be applied to all, some or individual categories, and the menu.
  • Google Web Fonts can be used.
  • A Google Analytics ID can be easily added.
  • Customisable introductory texts on the menu page.
  • Images attached to Tweets using Twitter are displayed in the slideshow.
  • A list of “greeting” messages can be set. These are displayed before newly-arrived Tweets.
  • A list of “slogan” messages can be set. These are displayed randomly between Tweets.
  • Options for each category include:
    • Show on the menu page, or hide it.
    • Number of Tweets rotated through.
    • Duration each Tweet is displayed.
    • Duration of the fade between each Tweet.
    • List of greeting messages.
    • List of slogan messages.
    • Chance of a slogan appearing.

Most of that can be changed by altering a single configuration file. When writing code for use by others I really enjoy trying to work out what kind of things they might want to customise, and how to make that possible in the simplest manner.

Twelescreen comes with two themes (CSS files) — the ‘Big Brother’ one you may now be familiar with (above) and the more practical default theme, seen on this example page (and below) showing public Tweets from my RIG colleagues, whose Dextr is an obvious precursor.

Phil Gyford: 'CD Slot Mount Invention of the Year Winner'

If you’re able, then give the code a whirl. Feel free to send me suggestions, whether for features or ways to improve what it currently does. It’s my first Node application so I’ve learned a lot by doing this.

Not least, I’ve been reminded how much longer it takes to make something with as few rough edges as possible and that has code suitable for other people to use. I estimate the whole project has taken me 15-20 days of work, even though I had something quite similar up and running very early on in that process. Designing by making, refining and polishing, refactoring nasty code, re-working the configuration, writing documentation… it all takes so long, even after the first rough attempt is basically working.

But here we are at last. It seems reasonably stable, but isn’t without problems, not least how best to load Google Web Fonts, which often seem to hold up page loading entirely. I’m sure there are other things that could be done to make it work better.

If you can get it running, and especially if you do anything particularly nice or interesting with it, do let me know!

Updated 5 July 2018: Changed links to point to instead of, which I let expire.

Commenting is disabled on posts once they’re 30 days old.

13 Nov 2013 at Twitter

  • 8:41pm: @alruii Totally locked up.
  • 8:15pm: @benterrett No camera has a shutter speed fast enough to capture my dynamism.
  • 7:58pm: @jamesbridle Ooh, congrats!
  • 3:46pm: @Beeker @alruii It’s like the Little Printer costume was made to measure!
  • 3:07pm: On the plus side, I’m not the one walking round the exhibition dressed as a roll of paper towels wearing a Santa hat.
  • 1:39pm: @jonty @iotwatch @tominsam @iamdanw Yes it was @jwheare’s code running the office screen, not an NDA thing.
  • 1:13pm: @textfiles Great, thanks! Hope you’re having a good time there.
  • 12:57pm: Sit down to lunch at the Greg Wallace Christmas Restaurant, in the exhibition centre, between the ice rink and Santa Balls.
  • 12:54pm: “CD Slot Mount Invention of the Year Winner”
  • 11:19am: Places like this remind me a bit of David Foster Wallace going to that state fair, or on that cruise ship.
  • 9:33am: Trying to stand out of the way of the fake snow falling at Earl’s Court. I’m sparing you photos of Christmas trees. November.

13 Nov 2013 in Links

On this day I was reading