Sunday, October 23, 2005

Experimenting with publishCategoryRss


Decided to try my hand at a little dabbling. Copied radio.weblogs.publishCategoryRss to workspace.myPublishCategoryRss. Made some edits and ran it as a standalone script, saw that I could make changes in the script and see changes in the category RSS file. Made updates to the following prefs:
  • weblogData.categories.DevKnowledgeorama.description - Changed description to "This is a test"
  • weblogData.categories.DevKnowledgeorama.displayName - Changed from "DevKnowledgeorama" to "Knowledgeorama"
  • weblogData.prefs.managingEditor - Changed from "ruminations@cybcon.com" to "andy@knowledgeorama.com"
  • weblogData.prefs.webmaster - Changed from "ruminations@cybcon.com" to "andy@knowledgeorama.com"
Ran my local script, saw updates in all of the elements I wanted to see in my category RSS file. Next, I added a callback (publishCategoryRSS) in user.radio.callbacks. I gave the table the address of workspace.myPublishCategoryRss. Made a post update, but did not see the title element in my category RSS file update the way I wanted.

As Tom Clifton mentioned in his post I referenced yesterday, it looks like adding a callback for publishCategoryRss did not work. Did some searching for a solution, found this page from Mark Woods on running macros to generate new pages. Following his lead, created user.radio.macros table, copied myPublishCategoryRss to it, then edited index.txt in the category folder to add a call to this script. However, this did not have any effect on the category RSS file.

Looked some more for other ideas, saw this page describing ways to publish a Radio category to a Salon weblog, read Mark Paschal's trick of waiting a few seconds in his Footbridge tool to be able to access data in weblogData.root. Decided to add a callback in user.radio.callbacks.upstream to my script, since that should run after all of the normal publishing tasks are complete. Checked my category RSS file, and that seems to have done the trick! Deleted the following changes:
  • Addition of macro to index.txt in category folder
  • user.radio.macros table
  • user.radio callbacks.publishCategoryRss callback table
This appeared again to produce the desired result. Brought up the desktop home page, however, and saw that the name of the category in the list had changed from DevKnowledgeorama to Knowledgeorama. Decided to add a new string to weblogData.categories.DevKnowledgeorama (titleName) and set it to "Knowledgeorama". Also set weblogData.categories.DevKnowledgeorama.displayName back to DevKnowledgeorama, and updated workspace.myPublishCategoryRss to use titleName for setting up the title included in the RSS file. Saw on the home page that the category name was back to DevKnowledgeorama. Did a publish, saw that the category RSS feed had the title I wanted.

Did a few tests with uploading other files. Created a gems directory in the devknowledgeorama folder, saw it upstreamed. Added a OPML file, saw it upstreamed fairly quickly.

1:56:39 PM