Connecting together as many blogging tools as we can find!
Radio UserLand
By Phillip Pearson
Tuesday, June 25, 2002Radio, by UserLand Software, has been many things over the last year or two. AFAIK it started off as a file-sharing app (thus the name), but turned tack and became a blogging tool instead after the RIAA took aim at Napster.
It was one of the first desktop web applications: desktop applications which include a miniature web server (in this case, Frontier) and communicate with the user through a web browser.
Enough of that - if you're reading this article, you're probably already familiar with Radio ;-)
Data Storage
Radio uses its own object database to store its data. If you open up your Program Files\Radio UserLand folder, you'll see a fairly large file called Radio.root. That one contains most of the scripts that run Radio - most of it is written in Frontier's scripting language, UserTalk.
Direct access to data
Weblog data is stored in the file Data Files\weblogData.root. As with CityDesk, you can open this up and have a look around inside if you like.
Start up Radio and open a window (right-click the system tray icon and select "Open Radio") then select weblogData.root from the Window menu. Expand the 'weblogData' item. Here are the useful sub-tables:
posts: This is where all your posts live. Each post is numbered with its post ID, and stores the following information:
Which categories it belogs to Whether it is on the homepage or not The post text When it was posted prefs: This stores configuration data.You can get at all this by writing scripts in Radio.
Template-based access
Radio generates RSS by default, so it probably wouldn't be hard to get it to generate some other format at the same time. The code to generate most things is in system.verbs.builtins.radio (hit Ctrl-J in the main window and enter 'radio' to jump there).
publishRss() and writeRssFile() would probably be a good place to start looking.
XML export
UserTalk has a very handy method: table.tableToXml(), which dumps an entire table out as XML. You can get an XML representation of all the weblog data with the following command:
table.tableToXml( radio.weblog.init() )
This returns a string containing the XML. To export the weblog data to c:\exportedWeblog.xml, run the following (Ctrl-; will pop up a "quick script" window that will let you run it without creating a script):
file.writeWholeFile( "c:\\exportedWeblog.xml", table.tableToXml( radio.weblog.init() ) )
Access by RPC
Radio supports the Blogger API and the metaWeblog API out of the box, although you'll need to change a security setting or two (permit Blogger API and maybe permit connections) before it will accept incoming RPC.
Both of these APIs allow you to pull out posts at random, although you need to know the post ID. The Blogger API has the following entry points (functions):
newPost: Creates a new post. editPost: Modifies an existing post, given its post ID. getUsersBlogs: Returns a list of blogs associated with a given user ID. In Blogger, a single user can run many blogs. In Radio, you only have one, so this will just return that - the blog ID will be "home". getUserInfo: Returns information about you. getTemplate: Returns your template. setTemplate: Replaces your template with one that you pass in.The metaWeblog API has the following entry points:
newPost: Creates a new post. editPost: Modifies an existing post, given its post ID. getPost: Gets a post, given its post ID. getCategories: Returns a list of categories for the weblog.In addition to this lot, it's not hard to make extra XML-RPC handlers by building your own tool.