Blogroll script

Been doing a little work on the site and this has involved writing some PHP code. I thought I’d share the scripts so others could benefit. I’ve created a new category for scripts and moved a couple of previous posts to it.

Today I wrote a script to read in an OPML file and output some HTML to a blogroll. Actually someone else wrote most of the PHP to do this I just modified it a little for Reactuate. Here is the script as it runs on Reactuate.

The reason I wrote the script was I use a news read called NetNewsWire Lite to read blogs. I wanted to post a list of the blogs I read on a regular basis. I thought I’d use AppleScript to read the list and create an HTML file. Well it turns out NetNewsWire Lite doesn’t do AppleScript. I thought I’d be upgrading to NetNewsWire Pro, but after using it during the beta period I decided it wasn’t going to use it for posting so I didn’t really need the full version.

So AppleScript was out, but NNW Lite will output your subscription list as a OPML file. So I did that and then needed something to make HTML out of that. I found the script used here and made some mods to get it look right here and let me put my OPML file in another location.

Now all I have to do is upload new OPML files and the blogroll with change on the fly.