Show Me...
Danny Ayers: So how would you do this: “Show me all the posts tagged ‘sun’ in the last month by the bloggers aggregated at Planet Intertwingy"
It occurred to me that I had all the parts readily available to mock up something for this by applying XPath to the canonicalized Atom entries that Venus caches.
To answer Danny’s question, the following query turns up a number of results:
//atom:category[@term='Sun']
Which I guess provides an answer of sorts to Tim’s question, namely "any scheme you feel like”.
You can also use this to find posts which contain “♫” characters in titles (Tim’s not the only one!), or use MathML (Hi Jacques!).
I’m not sure if I am going to continue with this experiment, but while it is up, you are welcome to play with it. Note: this implementation currently makes ample use of features like XPath so it is unlikely to work on IE just yet; in fact it may not work on any browser but Mozilla.
Most of the fun in creating this had little to do with the server side query logic, but in getting the client side AJAX aspects working. For client to server, I settled on application/x-www-form-urlencoded
, and discovered that escape doesn’t handle non-ASCII characters and that encodeURIComponent should be used instead. For server to client, I use XML, which turns out to be a quite reasonable way to represent a result set consisting of Atom 1.0 entries. As the text constructs have already been canonicalized to XHTML, importNode can be directly used even if the content contains MathML and/or SVG.
If I do continue, I’ll likely add alternative query syntaxes (like simple word matches or regexps), and add embellishments (like a sidebar that sorts sources by name and dynamically updates counters of posts scanned and posts found).
But even with a query syntax that only a geek could love, I a have a renewed enthusiasm for the serendipity that aggressive normalization enables.