blosxxxom – it’s not porn

In amongst all the talk of the Atom API (which might one day actually be released and usable) and RSS, and with me working on some XML/XSL things at work, I realised that there’s probably another option entirely with blosxom as far as templates/flavours/themes goes, and it goes a little something like this;

Three Xs, therefore blosxxxom, that’s one for blosxom (Apple’s OSX), one for XML and one for XSL, which are the three technologies we’re dealing with here.

  1. Install the theme plugin for blosxom and get it working (this plugin makes life much easier!)
  2. Now create a new theme, with a suitable name (mine’s called ‘blosxxxom’ for the sake of the experiment, and it looks like this; page.blosxxxom. This theme should create a valid XML document from your posts.
  3. Your XML output should refer to an XSL stylesheet, which will actually take care of doing the formatting, entirely client-side (style.xsl in my example theme file)
  4. In the XSL file, just use normal XSL processing instructions to handle the output and presentation of the XML document into XHTML!
  5. Point your browser to blosxom and tell it to use the flavour name that you used to create this theme, and you should be able to see what the output looks like. View the source of the document and you should see the plain XML produced by blosxom ๐Ÿ™‚

Now, for a couple notes;

  • I made my content_type value in the theme text/xml, but this forced blosxom to encode special characters to be nice for me. I found that it was better to comment this section of the main CGI out so that I could drop the values in, and wrap them in the CDATA tag seen in the XML theme.
  • Rather than worry about what’s in the body much, I just wrapped things in a <![CDATA[ tag ]]> to be safe.
  • Mozilla doesn’t currently display my output properly – it’s not doing links (or any tags) properly, and it’s just showing them rather than interpreting them as HTML. Anyone got any ideas on this one?
  • There’s more to be done, but it’s a fun point to start at, and there’s no reason why you can’t add things like a COMMENTS element to your STORY node, or a KARMA, a META node with a series of elements – it’s pretty free-form if you’re only doing the XML for your own presentation needs!

Hope that’s inspired some people to try some things out that they might not have otherwise tried, and if nothing else, it just demonstrates how flexible blosxom really is! ๐Ÿ™‚

Resizable Google

I don’t know if anyone else noticed, or indeed when it actually happened, but I know that a couple months ago, you couldn’t successfully resize the Google results pages using the ‘Text Size’ option in Internet Explorer.

Purely by accident, I opened a Google page with my text size set to ‘largest’ and lo and behold, they have modified their HTML to allow for resizing of fonts. Even their AdWords ads resize according to the browser preference.

Looking at the source, it looks like they are slowly moving towards a CSS-based layout/design, although they still have a ways to go. Incidentally, I did a copy of their layout with CSS for an internal search engine that I built and it wasn’t that hard at all, their design even lends itself to being done with DIVs, UL/LIs and A tags, styled up with CSS.

So here’s their style definition on a results page now-days;

body,td,div,.p,a{font-family:arial,sans-serif } 
div,td{color:#000} 
.f,.fl:link{color:#6f6f6f} 
a:link,.w,a.w:link,.w a:link{color:#00c} 
a:visited,.fl:visited{color:#551a8b} 
a:active,.fl:active{color:#f00} 
.t a:link,.t a:active,.t a:visited,.t{color:#ffffff} 
.t{background-color:#3366cc} 
.h{color:#3366cc} 
.i,.i:link{color:#a90a08} 
.a,.a:link{color:#008000} 
.z{display:none} 
div.n {margin-top: 1ex} 
.n a{font-size:10pt; color:#000} 
.n .i{font-size:10pt; font-weight:bold} 
.q a:visited,.q a:link,.q a:active,.q {color: #00c; text-decoration: none;} 
.b{font-size: 12pt; color:#00c; font-weight:bold} 
.ch{cursor:pointer;cursor:hand} 
.e{margin-top: .75em; margin-bottom: .75em} 
.g{margin-top: 1em; margin-bottom: 1em}

As you can see, they are not defining a font size for a lot of their elements, which is a good move, as it will inherit the browser settings automatically. One thing that I did notice is that the fixed-size fonts they are using (“.n a” and “.n .i”) are only applied to the numbers used for the links to different pages of results. I am assuming that they have done this because otherwise there’s the potential that thei cool little string of ‘o’s will be messed up from font sizing ๐Ÿ™‚

Good Work Google! Good to see more of the big-boys embracing CSS design, I just hope that they continue down this path and have a completely CSS-driven design in the near future, browsers are almost up to speed so that it’s a valid move for them I think.

UCMore At It Again

A couple weeks ago, I realised that the UCMore Toolbar was hitting my website something like 20,000 times a day (based on the User Agent string in my Apache logs). I looked into their site and it looks like it’s trying to get my favicon.ico (which I don’t have) to use as part of a suggestion for similar content to people using their toolbar.

I emailed the guys there and asked them to remove my site from their toolbar because that traffic was a waste, and the icon wasn’t even there. They replied courteously and said that they’d remove my site. A couple days later, the traffic dropped off to around 10,000 hits a day, but has since returned to, and exceeded, 20,000 hits a day.

I emailed them again, and they say they are taking care of it, but so far it looks like something similar is going to happen again (ease off, then jump up again). If things don’t change, I’m going to have to revert to a technique I have seen used around the place and use Apache Rewrites to redirect all traffic coming from their toolbar back to their site, which will be something like an automated DoS I suppose, although I don’t suppose that this amount of traffic will cause any problem on their server, but it’s a statement if nothing else.

Waiting, waiting — will give them 5 days from now.

Local WSDL

I’ve modified XooMLe slightly (Search, Spell and Cache) so that they use a local copy of the Google WSDL, rather than retrieving the remote one, because it speeds things up slightly (one less remote request).

Everything appears to be operating correctly on all operations still, so all’s well. I will also be releasing a downloadable version of XooMLe soon, so that you can host it on your own server and more thoroughly integrate it with your own search solutions.

XooMLe will be a free download when it becomes available (hopefully within a week). Sign up to the mailing list on the XooMLe Project Page to be the first to know when it’s available.