Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Sat, 10 Jan 2004
Hmm, it's harder than it looks
I was able to get started on coding MetaWeblog for pyblosxom last night. I got the XML-RPC skeleton code up and running and can retrieve the last N posts. The blogger API code for pyblosxom uses the blosxom directory name as the blog id, so it only searchs the directory named by the blog id. That seems wrong to me, because that's not really "the last N posts" it's the last N posts in that directory (category).
I also realized, after my excitement about Ecto, that I already have access to a nice weblog editor tool, the weblog editor built into NetNewsWire, so I started my testing using that. NNW has support for a number of different blogging systems and API's. Most systems that NNW supports are using the Blogger API, and MovableType uses both the Blogger API and the MetaWeblog API. In the array of structs that metaWeblog.getRecentPosts returns, I included information about the category of the post. Unfortuanately NNW doesn't make that information available. I started experimenting with the NNW commands and observing which MetaWeblog API calls were getting made. When NNW opens up, it never issues a metaWeblog.getCategories call. So it doesn't know what the categories are. If you do refresh it does a metaWeblog.getRecentPosts - but no call to get the categories. The retrieved posts are shown categoryless even if that information is in the return results.
One of the big reasons that I didn't use w.bloggar on Windows was that it couldn't deal with categories. NNW supposedly can do it, but you need the MovableType support. The biggest problem for somebody in my shoes, is that the metaWeblog (and Blogger) API's doen't say what the client is supposed to do about categories. If someone knows the correct sequence of metaWeblog API calls to retreive a set of posts which will have their categories displayed properly, that would be a big help.
In frustration, I looked at the Holy Grail, er, Atom API, but there's no description akin to the one that I want. So, just to be even handed, none of the specs have enough detail in them.
API documentation / specs has been both postively and negatively affected by tools like JavaDoc. These tools make it easy to document the individual methods of a class, but they don't help much with the "sequence diagram" problem, of documenting the right choreography of method invocations.
Looks like I'll be stuck with my little CGI for a while longer. I could use NNW's blosxom directory support but then I'd just be writing files in the file system. I could use SubEthaEdit's live HTML preview and my CGI -- the CGI can lace in categories, and does trackback, pingback, and notification pings. A good implementation of the Atom or MetaWeblog API's should be able to trigger such notifications as well.
[17:03] |
[computers/internet/weblogs/pyblosxom] |
# |
TB |
F |
G |
6 Comments |
Hi Ted, happy to help with the MetaWeblog API if possible. I looked and it does seem to explain categories in the docs. I've written code that deals with categories so I know it works in some circumstances. What specifically do you need to know how to do? Dave
http://www.xmlrpc.com/metaWeblogApi
"For categories, pass an array of strings of names of categories that the post belongs to, named categories. On the server side, it's not an error if the category doesn't exist, only record categories for ones that do exist."
Posted by Dave Winer at Sat Jan 10 17:55:16 2004
http://www.xmlrpc.com/metaWeblogApi
"For categories, pass an array of strings of names of categories that the post belongs to, named categories. On the server side, it's not an error if the category doesn't exist, only record categories for ones that do exist."
Posted by Dave Winer at Sat Jan 10 17:55:16 2004
Dave,
How is a client (like NNW) supposed to figure out what categories are available? I can see 2 possiblities:
1. A the beginning of a session, call metaWeblog.getCategories() and store that list and then do newPost or editPost
2. call editPost and use the categories included in the struct for the post (this prevents you from changing the category to one that isn't already attached to the post -- for that you need the whole list).
When I used NNW, and it called getRecentPosts -- the posts that I returned had categories attached, but NNW didn't recognize them. I need to mail Brent about that.
Posted by Ted Leung at Sat Jan 10 18:24:49 2004
How is a client (like NNW) supposed to figure out what categories are available? I can see 2 possiblities:
1. A the beginning of a session, call metaWeblog.getCategories() and store that list and then do newPost or editPost
2. call editPost and use the categories included in the struct for the post (this prevents you from changing the category to one that isn't already attached to the post -- for that you need the whole list).
When I used NNW, and it called getRecentPosts -- the posts that I returned had categories attached, but NNW didn't recognize them. I need to mail Brent about that.
Posted by Ted Leung at Sat Jan 10 18:24:49 2004
Hi Ted, since you're on a Mac, you should definitely give ecto (http://www.kung-foo.tv/ecto/index.php) a try - it's the coolest Weblog editor software I have seen so far.
Posted by Stefan Tilkov at Sun Jan 11 04:26:33 2004
Posted by Stefan Tilkov at Sun Jan 11 04:26:33 2004
F*ck - I just saw that ecto was what prompted you to start this in the first place, so never mind ;-)
Posted by Stefan Tilkov at Sun Jan 11 07:45:06 2004
Posted by Stefan Tilkov at Sun Jan 11 07:45:06 2004
Ted, I totally don't understand the issue. Is it a trick question? I'd expect NNW to do #1. What does it actually do? Perhaps we should handle this in email. My email address is part of this message form.
Posted by Dave Winer at Mon Jan 12 03:44:40 2004
Posted by Dave Winer at Mon Jan 12 03:44:40 2004
Dave,
It's not a trick question on my part, at least not intentionally. I thought NNW should do 1, but it doesn't. It doesn't seem to do 2. In this case it would be nice if the spec also told client writers, "to make sure you get the list of categories, folows the steps in 1". Maybe it says that but I missed it, and NNW at least doesn't do that.
I'll send you this comment via e-mail and we can continue there if you like.
Posted by Ted Leung at Mon Jan 12 10:29:58 2004
It's not a trick question on my part, at least not intentionally. I thought NNW should do 1, but it doesn't. It doesn't seem to do 2. In this case it would be nice if the spec also told client writers, "to make sure you get the list of categories, folows the steps in 1". Maybe it says that but I missed it, and NNW at least doesn't do that.
I'll send you this comment via e-mail and we can continue there if you like.
Posted by Ted Leung at Mon Jan 12 10:29:58 2004
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk