This is as days pass by, by Stuart Langridge

Giving searchhi a bit of a makeover

A user of one of the scripts I wrote a while back, searchhi, dropped me a mail to say: it would be handy if I could take some action if no hits are found. After a bit of probing, it turned out that they were using it for an in-page search -- what searchhi actually does is look at the referrer to see if you came here from a Google/Yahoo search and highlight the stuff you searched for -- so you could fill in a search form and then search the words in the page and highlight them. I'm at a bit of a loss as to how the built-in browser search (which is Ctrl-F for everyone, I think, although Macs might be different, and I use / on Firefox) doesn't satisfy this need, but needs must and all that. Hacking both of those things in (have a <form class="searchhi"> in the page and its first textbox will automatically be used as the search entry) was relatively quick. The nice thing about this is that I took the opportunity to tidy the script up a bit; it was written some time ago, and created its functions in the global namespace, was careless about var, that sort of thing. I'm now a bit happier with it -- it passes JSLint for a start, modulo that I disagree with Douglas about single-line if -- by which I mean that I don't cringe when I look at it. (I haven't documented the changes on the searchhi page itself, because the in-page search stuff is obviously JavaScript-dependent and that's not how you should do it, so I don't want to encourage people to use it.)

Back from UDS

Last week I was at the Ubuntu Developer Summit, the six-monthly big meetup for Canonical employees and the Ubuntu community to get together and work out what's in the next version of Ubuntu Linux and how to do it. It was fascinating meeting everyone and seeing it all up close. Lots of stuff went on: I got interviewed by the Ubuntu UK guys for their podcast; I caught up with a few people I hadn't seen for a while and lots of people I'd never met face-to-face before; I threw together a quick "lifestream" bit of JavaScript which would track a tag across various sites and it ended up on Launchpad (so if you want a trivial way to display a lifestream for a conference, grab the script and make it better); I asked everyone I could think of whether I should insist on buying a laptop with Ubuntu on it and which one I should get; we went to the Computer History Museum and indulged in the geek oneupmanship game of saying "owned one of those, owned one of those, wanted one of those" (apparently the PlayStation 1 is now Computer History); and I drank a fair amount of beer. Was a good week. I was there because I was paid to be so by Canonical. I start work for them at the beginning of January. While there I met the people who will be my team when I start, and saw some of what they're working on, and I'm really rather excited. I'm going to be part of Online Services. Can't wait to get going on it. I get to make the desktop I use be better.

Sending posts from Twitter to Identi.ca part 2

A while back I wrote a reflector which sent posts from Twitter to Identi.ca if you want to post to both. However, that required running your own code, which is hardly in the spirit of Web 2.0 and cloud computing and all that. So, now, here's how to send your posts from Twitter to Identi.ca without running any software yourself.
  1. Sign into Twitterfeed with your OpenID (Ubuntu users, if you don't have an OpenID you can use your Launchpad ID: https://launchpad.net/~fred-bloggs )
  2. Say "Create new Twitter feed"
  3. Change it to be a laconi.ca feed
  4. Set the feed URL to be http://pipes.yahoo.com/pipes/pipe.run?_id=WvUZFt_G3RG6Veiqbbsjiw&_render=rss&twitteruser=YOUR_TWITTER_USERNAME
  5. ...and you are done
The pipes.yahoo.com stuff is there because if you just use twitterfeed to send your Twitter user RSS feed direct to identi.ca then all your posts have "sil: " at the beginning (or whatever your username is). The Yahoo pipe strips that off. If you want to post to Identi.ca and have your posts show up on Twitter* then Identi.ca does it for you; just set it up in the Settings section of Identi.ca.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.