2005-12-05

Getting Categories in OPML Editor

Posted in OPML Editor at 7:18 am by cori

Dave Winer’s trying to retrieve the categories from a WordPress blog but isn’t having much success. Since I’m running both a WordPress.org and WordPress.com site I thought I might be able to lend a hand, but Dave seems to be looking for people with proven WordPress expertise.

I did some digging on my own and found that it was pretty easy to install a script like the one that Dave references; simply open the ftsc file using OPML Editor’s File | Open menu selection and OPML Editor will try to install it, asking where you’d like to put it. Not much to explain, really. Since I was trying to hack this on my own I installed it to a slightly different name than the default, and I had to change some of the test code to have it run against my WordPress.org blog so that I could look at the log file.

Everything looked fine to me in the log file, and I get back a list-type entry in the scratchpad that reflects the correct number of categories for that blog, with each entry a Table with 5 items. Since it’s a list I can’t expand it or see mor detail. Same thing if I allow it to run against my WordPress.com blog (this one). If I change the Kind of the list to, say, Outline (first I had to change it to a string, then I could change it to an Outline), I see a categoryId, categoryName, description, htmlUrl, rssUrl.

This doesn’t quite follow the MetaWeblog specification for getCategories, which specifies to return a struct with 3 elements (description, htmlUrl, rssUrl), but WordPress uses both categoryId and categoryName, and I don’t know what Radio or other blogging platforms use. I suppose it kind of makes sense that the structs returned include those values.

What I don’t understand, not knowing Frontier programming well enough, is why this is returned as a list instead of as a table (which seems the most logical Frontier representation of a struct, and also appears to be what Dave intended in the script).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: