I have been able to write a small software based on what I have written in Tag clouds, part 3. And it works decently. The software generates html code for tag clouds. But it is far from complete, yet.
I made another discovery yesterday. WordPress XML RPC Support provides links to various xmlrpc based apis. But the information is confusing. And links to the movable type apis are broken. Lorelle provides the correct link – Six Apart Developer Documentation – XML-RPC. There is a very interesting api – wp.editPage, which can be used to edit a page remotely. So, if I have a separate Tags page, I can make the software automatically update the page on every run. No manual copy-paste stuff needs to be done. There is a minor setup procedure which is required. But I find that acceptable.
Checkout my tag cloud page which is edited remotely though the software. [Edit: Nov. '09; I don't find the separate page to be of much use. The wordpress tag cloud widget is sufficient for most needs.]
I have to sort out a few issues -
- The code is very brittle and needs cleanup. Even after that is done, I can’t say that it will work in all cases coz, being new to wordpress, I am not aware of how things work in different installations/ scenarios. All I can say it is that it satisfies my present requirements.
- Slug renaming needs to be implemented. Presently, it only replaces spaces with dashes/ hyphens while creating tag urls. I googled for any other requirements and have come up with the following information -
- How to Write Descriptive Titles without Making URLs Too Long in WordPress
- WordPress Post Writing Advanced Features
- Understanding WordPress Permalinks
As of now I have decided to allow only A-Z, a-z, 0-9, – and _. Spaces will be replaced by hyphens and multiple back-to-back hyphens will be consolidated into a single one. That is what wordpress seems to do. One more thing I found out was that slugs are limited to 55 characters.
- Another problem is that the apis do not expose the post status (draft, private, pending review, public). So there is no way to know if the tag cloud is pointing to posts that cannot be accessed publicly. This bug has been noted on WordPress trac and won’t be taken up till WordPress version 2.4. So, using the software with private or unpublished draft posts will give incorrect results.
That, I think covers most points. Let me see how things proceed from here and when I can provide the source code for download.