Witterings from the Site owner

Still Alive


I know its been pretty quiet round here for a bit. Its just been one of those periods of time when I’d nothing really to write about, and even if I did I didn’t really have the time, or the motivation, or the energy.

When I’ve not been working I’ve been bashing my head against the wall over my Wordbooker plugin which I’ve been playing a continual catch up game with Facebook and WordPress and W3C compliance (some of which was nothing to do with me but actually Facebook’s decision to use non compliant tags and people having WordPress themes with not quite the right Doctypes and other things). I’ve been wanting for ages to start on Version 2 of the plugin – which takes a different approach to parts of the posting process and needs a complete re-write of the comment handling process too, but until I’d got the 1.x code base to the point that it was stable enough to leave alone so I could concentrate on 2.0 I couldn’t do that. I’d just got ready to start recoding when Facebook announced they were changing the method of authenticating users against applications… that’s right. Just a couple of months after they changed it totally they are proposing changing it all again. It didn’t help that they accidentally turned on the new method and broke everything!

But things seem to have settled down and so I’ve started coding it, but I also wanted to watch “Travelling Man” which Nick had bought me on DVD for my birthday after we’d both read Andrew Denny’s blog entry about it. It’s been quite enjoyable watching it and recognising a lot of the locations, even if they have changed a lot since it was shot : for example the derelict warehouses near Preston Brook have been turned in to rather up market apartments – but it was good to see that Claymore Navigation’s boatyard hasn’t changed much in the intervening years.

So today I’m having a day off work, and I could be coding but instead I’m listening to Bob Geldof’s solo albums and trying to rustle up enough motivation to do much more than slouch on the sofa all day. I know that some would say that NOT listening to them would be enough motivation to get off the sofa, and others might say that listening to them just sucks motivation away from you, but hey… it’s my day off and I’m waiting for the Dishwasher to go through a cleaning cycle!

Revisiting “old” Code


Nick commented once about some of the code in CanalPlan AC and how it was suffering from “bit rot”. Basically code that you shoved in, often as a quick dirty fix and then it starts to fail but with no good reason.

Well Wordbooker is suffering from bit rot, its just that luckily no-one has noticed it yet, well apart from me that is.

Wordbooker took code written by Robert Tsai for his plugin (Wordbook) and extended it. That is why Wordbooker is called Wordbooker – because it stands for WordbookE[xtended]R[elease]. Robert’s code used to support the WordPress PHP libraries for PHP4 and PHP5. PHP4 support was dropped but the wrappers were left inside the code, adding a level of abstraction around the calls to the Facebook PHP libraries.

When I added all the new features such as posting to walls and FB widgets and so on, into his code I sometimes used his wrappers and sometimes made the calls directly.

Facebook then depreciated some functionality and so calls to functions supporting that got commented out and eventually I stripped most of the code out.

I’d added functionality to handle comments really as a sort of proof of concept and then I added posting support to pages, but comments to pages didn’t get processed properly due to slight differences inside FB on how pages are handled.

So that was the next big project – re-write comment handling to make it a lot more robust (and at the same time simpler).

But then Facebook came along with the Graph API and the Oauth authentication process and said that all applications would be force migrated to the new Authentication method on June 1st. The new Graph API would make my job simpler as I only use a few calls (post to wall, post comment, get comment, get status, and a few FQL calls) and so obviously I should think about moving my code to use it.

That wouldn’t be bad if the Graph API was complete and not riddled with bugs (for example if you include a link in a post it thinks you are doing a “share” style post and goes and scrapes that URL – something which is not right and not how the old API works), but as it is I can’t use the new API for anything but authentication, so I’ve had to work out how to use the Oauth method for signing on, but then use the old API for the rest of my code, all under the looming date of the end of the month and with me working a day job as well.

Facebook also changed their policy on posting to walls and I asked them for clarification, and they asked for more information which I’ve given them, and now I’m waiting to hear back from them. It could mean that I have to change my code, but actually it will make the process easier to code and make it easier for the user to understand, so I am going to make the changes any way.

WordPress is also changing – with 3.0 coming out really soon now – and I wanted to make my install more multiblog friendly : so 4 tables per WP install rather than 4 tables per blog which means some quite jolly logic to work out if you are in WP2 (or WPMU2) or WP3 (running in single or multiple blog mode)

So I’m revisiting my old code and wondering if I should really throw 80% of it away and strip away the crud and spaghetti that seems to have collected during my rapid development of the project. I’ve now got a much clearer idea of how things should work and how the code should flow, and how to code round the countless “failures” of the FB back end which occur at depressingly frequently intervals, some of which I did last night when a couple of users were basically stuck because FB were playing round with code on the live servers again.

So much for Mobile broadband


Was trying to check a problem with Canalplan AC today and as its sitting on the server in the living room I thought I should try it “remotely” rather than access off the local network.

So I got the O2 broadband dongle and powered it up and connected, and couldn’t reproduce the error… Oh well, thats how things go, especially when you are talking about IE8.

So whilst I was connected I thought I’d just hop onto this blog site and check a couple of things.

Sorry – No Can Do! Not Possible. Kept telling me the site was not available.

But it sits on the same server as Canalplan AC. It sits on blogs.canalplan.org.uk when Canalplan is on www.canalplan.org.uk.

So if one responds, then the other other should. Right?

Well you are wrong:

Here is the output of a ping command:

Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\steve>ping www.canalplan.org.uk

Pinging www.canalplan.org.uk [212.159.61.36] with 32 bytes of data:

So that’s good – its getting the IP address. It wont ever respond to pings because the router dumps them.

So lets try for the blogs:

Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\steve>ping blogs.canalplan.org.uk
Ping request could not find host blogs.canalplan.org.uk. Please check the name and try again.

Nope – its not there.

The DNS servers for O2 don’t recognise it as a valid host name.

Tosspots.

OR rather its their Windows software that is screwy. If I power up under Linux then it works fine!


Server uptime: 73 day(s), 22 hour(s) and 48 minute(s) | Server Load: 0.00, 0.05, 0.07