Welcome to Geoffrey Swift's βlog. Please subscribe to the Atom feed.


Highlighting of search terms from referer

Having had a look through my referer logs, it was clear people were obviously using Google to find the site. To make things easier to find, search terms used on Google are now highlighted in the page when a user finds their way here.

The work happens in the browser, rather than the web server producing a modified version specially for the user. This way caching all works as normal.

The first step is to parse the search query, into individual terms. Then my code recursively searches through the DOM and finds any text nodes which match the current search term. Any such text node is then replaced by a sequence of nodes containing either highlighted and unhighlited text.

The hard work in this is all done through regular expressions and the DOM/CSS. Try it out for yourself and use view source if you're really interested!

Darkside Drum & Bass mix

I did this mix a while ago now, but haven't had chance to upload it as I'm currently without an internet connection at home! The mix starts off with some techy stuff and winds down with some old classics.

Download: http://www.trollied.org/~blimey/blimeydnbmix2.mp3 (55 MB)