Archive for the ‘meta’ Category

What’s Twitter for?

Wednesday, February 25th, 2009

Discounting the last week, my last blog post was on 24 October, then 3 July, then 18 April. Prior to that I was posting a couple of times a month. So what happened to my blog in 2008?

I started using Twitter.

Twitter has been getting some mainstream press lately, mostly though celebrities using it — especially Stephen Fry and Jonathan Ross. As with any new communication medium people are asking: what exactly is it good for? On the Twitter website the synopsis is: "What are you doing?" Well, that doesn't quite describe how I use it. Here's what I use it for.

I use Twitter for semi-realtime conversations.

It may have started out as "What are you doing?" but really, that's just the starting point. Sometimes you really do say what you're doing and if your friends find it interesting, they can comment on it. And not only what you're doing — what you're reading and thinking too. I made only two "QOTD" blog posts last year because I was using Twitter to point these out instead.

Using TwitterFox, which makes my followings instantly available, it's more immediate than a blog and its comments which you have to dive into a feed reader to follow. It's also more uniform than blogs-with-comments, in the sense that the original message and its replies have the same status — they are both just tweets, whereas a blog post is somehow more important than the comments attached to it.

But at the same time it's less immediate than, say, Milliways, or IM. There was a gaping hole between realtime chat and blogging in terms of immediacy and Twitter fills that gap, which I think is why it's so popular. Nobody really wants to know what you are doing every minute of the day and of course letting them know can be dangerous. But it's for sparking discussion and carrying it on, in a way that's in the present yet not demanding that you pay constant attention.

RSS is dead, long live Atom!… err… sort of…

Saturday, January 21st, 2006

Having found out that, unlike RSS, Atom allows embedded XHTML (and moreover is infinitely better defined), I’ve spent this evening converting my blog to emit it instead of RSS. So, if you’re reading this at http://sucs.org/~pwb/blog/blog.py, you’re looking at Atom with XSL instead of the old RSS with XSL. For some silly reason Atom still uses plain text dates instead of XML, but that’s not actually a huge problem for the XSL as the format it does use, ISO 8601, can be manipulated using an XSL date-time library.

Annoyingly, it seems that although Planet understands Atom to a degree, it can only cope with content as CDATA (which ought not to be interpreted as XHTML elements, as Planet does, but rather as plain text). So my feed, whose content elements contain XHTML divs and are marked with the type="xhtml" attribute as the Atom spec dictates, are nonetheless stupidly interpreted as plain text. It’s exactly the reverse of how it should be handled. So my old RSS feed is still there, at least until such time as Planet gets fixed, but is deprecated and will probably not get maintained any more.

RSS incompatibility

Friday, June 3rd, 2005

Looking around on the web for a decent (i.e. formal) specification of RSS, I found this page.


It looks like not only is there no formal specification for RSS 2.0, there are in fact several indistinguishable but incompatible versions all calling themselves RSS 2.0. Sigh. How the fsck am I supposed to figure out how to make my RSS valid if there’s no formal spec for it, much less a DTD?

fixed timezone stuff (RANT WARNING)

Thursday, June 2nd, 2005

Just spent hours hacking up these scripts again to make them handle timezones properly (originally because RSS pubDate elements require an RFC (2)822 date, and mine wasn’t providing a timezone).

This was made particularly hard by

  • the lack of support in MySQL for timezones in date types (why oh why?)

  • the insistence of MySQLdb (the library I’m using to interface with MySQL) on using an undocumented date class called DateTime instead of any of the standard Python libraries (actually, it seems to be a half-arsed form of mxDateTime, with no indication as to what’s implemented – and of course having the same name (except for case) as one of the standard libraries makes it impossible to google for more info)

  • the fact that Python knows what the current timezone is, but there is no straightforward way to find it out. There is an abstract tzinfo class but no subclasses or instances are defined, and of course, though the timezone of datetime.utcnow() is always the same, neither it nor datetime.now() have tzinfo fields unless you provide them! You have to figure it out manually by rounding datetime.now() – datetime.utcnow() to the nearest hour. Fscking irritating.

Steve pointed me at help(“time”) which gives a marginally less roundabout way of doing it… but that still involves checking one variable to see which of two other variables to use for the value, which you still have to convert into a string. All I want is the +/-XXXX descriptor! You’d think there’d be a single string variable or function to do this, but nooooo…

XSLised blog is live!

Wednesday, June 1st, 2005

Yes that’s right folks, you’re now looking at a pure RSS blog! (Unless you’re watching through SUCS Planet or something.)


How is this possible? It’s all due to a very funky mechanism called Extensible Stylesheet Language Transformations (XSLT), which lets you take some arbitrary XML data and present it in some other XML form. In this case the XSL stylesheet blog.xsl just turns an RSS file into the XHTML you are looking at right now. The best bit is that this is all done by your browser, so the only script I have to maintain for the blog is the one to generate the RSS file.


Of course, your browser has to support this. The two most popular browsers in the world, MSIE and Mozilla Firefox, both do this without a hitch (though making it work in Firefox is slightly more tricky as IE ignores some details to do with XML namespaces that make Firefox forget it’s looking at XHTML). Opera, that other browser advocated by some fanatics of questionable intelligence, has no support whatsoever. Since the blog will be on SUCS Planet soon enough anyway, this shouldn’t stop you reading it.

Blogs in XML with XSL

Monday, May 30th, 2005

I’m currently investigating using XML with XSL to serve my blogs instead of writing it in XHTML to start with. It looks like it will be very easy to serve my blogs as raw RSS with a stylesheet, which the browser uses to turn it into XHTML. Funky.

I’ve got a test page demonstrating this with the same CSS style sheet as this blog. I don’t see that XSL will replace CSS for XHTML as it has a much easier to understand syntax, even if it’s not as flexible.

The next incarnation of these scripts will hopefully output RSS which can be aggregated into SUCS Planet :)

Hello world!

Wednesday, May 11th, 2005

Blogging seems to be all the rage atm, so I’ve decided to write my own.

This is all done using Python (see the nifty “Python Powered” logo at the bottom :) using a custom library that represents arbitrary XML elements including content and attributes as Python objects. Each element has a show() method which calls the show() method of every object it contains (and prints any free strings, usually).

In the Real World (whatever that is): I had my oral exam on Tuesday. I thought it went pretty well, although you can never really be sure of that in advance.