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

2005-11-29

OPML Editor as WordPress blogging tool: hack #1 (or is it #2?)

Posted in OPML Editor at 9:41 am by cori

I’ve found (and/or created) a couple of hacks that make using the OPML Editor as a WordPress (and other blog platform) blogging tool a little nicer.

The first applies if you want to use OPML Editor to blog to multiple Metaweblog-based blogs. Right now to do so you have to set each one up in your preferences, and decide before creating a new post which blog you’re going to use (or at least that’s what it seems like).

If you’re up for a little OPML Editor hacking, you can make this a lot less of a hassle.

What you need to do is to create a right-click menu item by using the “Tools | Edit right-click menu” menu item. In the resulting outline enter a new node and name it whatever you want to call your new entry. Then double-click this node to open the script for this action.

In the script window, type the following:

This script causes OPML Editor to pop a dialog box when you right-click on a node and select your new menu item (mine’s called “Set Att”). It will ask you for the attribute you want to modify. If the attribute has a value it’ll put ha value in another dialog, if not you get a blank dialog. Type the new value you want and OPML Editor will either update the existing attribute or add a new one.

For the purposes of WordPress blogging using the OPML Editor, you can right-click the top-level node (the one with the title) of your newly added post and type “blogname” for the atribue you want to modify. Then type the blogname value for the blog you want to post to (from the list you’ve created in your prefs) and when you save the workspace you’ll post to whatever blog you’ve selected.

If any of this doesn’t make sense, please leave a comment and I’ll try to clarify it – I didn’t want to get too basic here, but in doing so might have left ou too much detail.

Next Up: hacking a little deeper into OPML Editor’s code to control post status (draft, published).

2005-11-23

First right-out-of-the-box OPML Editor WordPress.com post

Posted in OPML Editor at 4:27 pm by cori

having figured out the vagaries and quirks of the UI (don’t all UIs have them?) I think I’m able to post without issue.
We’ll see how this one goes.