html

Crouching Harold, hidden formats

jp.stacey 19 July 2006

Elliotte Rusty Harold roundly Read more

Save our servers!

jp.stacey 11 June 2007

Sick and tired of getting a million hits, all to the same page, which more often than not hasn’t been updated in the mean time? Want to reduce your bandwidth and server-time loads without necessarily impairing your visitors’ experience of your site?

Programming shouldn't be degrading

jp.stacey 19 September 2007

Steve compares “graceful degradation” with “progressive enhancement.” Mostly he takes issue (rightly) with the rhetorical spin that the former applies to the idea of building a website. But I think you can compare them with each other as if they were two different types of crowbar instead: two ways of prising open the task in hand.

Pretending that Javascript is XSL, part 1: XSL, CSS and JS side by side

jp.stacey 18 December 2007

There are three main technologies that your browser employs to present HTML for you: XSL, CSS and Javascript. The first two of these are functional: that is, they turn your incoming (X)HTML documents into a set of functions, or behaviours if you like. Because CSS isn’t generally considered a language, let alone a functional one, then it’s worth seeing an example in both languages. Here’s the CSS:

p.intro { color: green; }

And here’s a sort-of XSL equivalent:

Pretending that Javascript is XSL, part 2: jQuery++

jp.stacey 19 December 2007

If you’re here, then you probably came from here, and you want to make Javascript more functional. If you didn’t come from there—and this is getting a bit like a Choose-Your-Own-Adventure book, isn’t it?—then you might want to go there first, to see if you want to be here.

Spliticket running again with BeautifulSoup

jp.stacey 7 September 2008
Or, how I learned to stop parsing and love the soup

Ages ago Matthew Somerville emailed me to say that spliticket had fallen over. It's my hacky interface to his wiki page documenting split tickets, and ultimately it found the vagaries of even wiki-generated HTML a bit too hard to cope with.

At the time I built the HTML parser using core SAX-based HTML parsing, and it was horrible.

BeautifulSoup available for Python 3

jp.stacey 25 January 2009
Python 3 can now strip the hell out of webpages just as well as Python 2.

A Python3-compatible version of BeautifulSoup is now bundled with the Python2 BeautifulSoup tarball. It's actually been available since 27 December, but the most recent version 3.1.0.1 addresses a bug in attribute handling.

It's a bit fiddly to get it working---you need patch, and both python3 and 2to3 on the command line (and 2to3 to be called 2to3-3.0---but when it does so, that ol' BS magic is pretty clear.

Tonight we're gonna parse like it's 1997

jp.stacey 23 February 2009
Opinions are like closing angle brackets: everyone's got one, but some stick out more than others, depending on your kerning

Via Sean McGrath comes a reasonably lucid and comprehensible redux of the argument about of whether or not the XML standard should (or should have) stipulated draconian error handling.