Stubblog


How to fix Twitter
May 21, 2008, 11:53 am
Filed under: twitter | Tags: ,

Looks like Twitter dropped a bollock the other day, the site was down for the whole day when a db upgrade went a little wonky. Everyone seems to be dreaming up weird and wonderful replacements and backups for Twitter, but there’s already a very suitable one that lots of people have long forgotten about. It’s called IRC.

The two main features of Twitter are following people and sending private messages. If you imagine every user having their own channel, set to +m so that only the op (or others with +v) could send messages. Setting +n to stop outside messages would probably be a good idea too. You could also implement groups by giving multiple people +v in a channel.

Private messages are easy with IRC’s /msg command, but could be open to spam, a little modification to IRC servers would only allow people who’s room you are in can send you private messages.

There are plenty of libraries available to implement those pretty clients like Twitteriffic or Twhirl or you could use a more traditional client if you prefer, but using IRC in this manner would probably be better with a dedicated client, or a web interface.

So there you go, anyone want to pick tis up and run with it?

Many thanks to AndyD for the channel modes ;-)



IE can’t set name attribute dynamically.
May 1, 2008, 12:00 pm
Filed under: firefox, ie, javascript, Uncategorized

I keep tripping myself up with this one, IE is unable to set the name attribute for any dynamically created DOM nodes. It doesn’t matter if you clone an existing node, or create a new one, IE won’t set the name attribute.

Have a look at this example:

var newCheckbox = document.createElement('input');
newCheckbox.setAttribute('type', 'checkbox');
newCheckbox.setAttribute('name', x[i].name);
newCheckbox.setAttribute('value', '0');
newCheckbox.setAttribute('checked', 'checked');

x[i].parentNode.appendChild(newCheckbox);

Will result in a new input element with no name attribute. The only way I’ve found to counter this, that works in both IE & Firefox is to use innerHTML.

var newCheckbox = document.createElement("span");
newCheckbox.innerHTML ="[input name='" + x[i].name + "' type='checkbox' value='0' checked='checked']";
x[i].parentNode.appendChild(newCheckbox);

Is there a better way? I’d be interested to hear about any other solutions that might work.

-S



Manchester United Vs Chelsea … I wont be watching the Champions League final.
May 1, 2008, 11:04 am
Filed under: Champions League, Chelsea, football, Manchester United

So this years Champions League final is between Chelsea & Manchester United and I couldn’t think of a worse advert for British football than this. It’s a repeat of last years rubbish display of football that was the FA Cup final, one of the dullest games I’ve ever watched.

Chelsea always play not to concede a goal and score on the break, and if the tactics deployed by Manchester United against Chelsea the other week are anything to go by, so will they. Hopefully they will have learned a lesson and not repeat that.

I’m not a fan of any of the teams involved in the semis, but I think a Liverpool – Manchester final would have been a much better advert for football in this country. At least the 2 sides would set out to play attacking football. You just have to look at the top scorers table and Liverpool have 4 players, a total of 22 goals between them.