I wrote a FOAF parser for PHP5

Well at least I did something useful with my first of a week of overnight shifts, and that was to do some programming. Clairey’s been talking about trying to setup a page to process the Livejournal FOAF (friend of a friend) XML feed, but not getting anywhere with it. I’ve done XML stuff before, and I thought I would help her out, and as usual, with the times that I decide to help someone out with coding something, it turned into a mini-project.

I started around 11pm, and it’s now 4am, and I’ve just completed writing up the comments and short documentation on the class that I made. I’m probably not the first person to do it, but I’ll put it up here as a static page to see if there’s any interest in a class that’ll take a FOAF page and give you some useful output in PHP. So far it’ll parse the file, and set some variables for you to access that allow you to use them in your application. It’s pretty simple to use, just include the file, create the class and execute a function and it’ll go on its merry way.

The problem with it is, it won’t actually work on PHP4 since it requires the “simpleXML” library, which is only in PHP5. Oh well, I might port it to PHP4 later, since there isn’t many servers actually running PHP5 yet. That looks like a big nasty task that I can’t be bothered doing, since I can’t work out if it’ll actually let me use the class how I want to – which sucks, since the way it’s set up now is so nice and easy to use!

I wish I could upgrade the server that I have to PHP5, I think there’s a lot of things that I could do with it, quite quickly – the class implementation is a lot faster, and really nice to use to make programs with. Since I’m looking at getting rid of the dedicated server itself (not much use keeping it if it’s costing me $150/month for my blog) I might try to find someone that’s got PHP5 installed and go with them.

#Programming #Work