A simple enhancement to the XML-RPC server

As I've been working on the OPML Editor, I've been making enhancements to the runtime environment. Occasionally I come across something that's worth propogating to all the Frontier-based environments, and I think this is one of them.

The idea

When I was working on the ping sever for Share Your OPML, I needed to have the pings go to a new domain, so they could be processed differently from (for example) pings of OPML-based weblogs.

My first thought was that I'd have to put the software on a different machine, but then I thought maybe I could improve the XML-RPC server to have it branch to different places based on the HOST header of the HTTP request. It turns out it was very easy to do.

How it works

1. All the code changes are in betty.rpc.server.

2. A new preference, user.betty.prefs.flServerDomains, is defined and initialized, defaults false.

3. If user.betty.prefs.flServerDomains is false, then nothing new happens. Everything is exactly as it was before.

4. If user.betty.domains is defined, then we first try to route the request through that table. If there is a HOST header, and its value is xyz, and user.betty.domains.xyz is defined, then route through that sub-table. If it is not defined, route the usual way, through user.betty.rpcHandlers. The routing "walk" works exactly as before, it's just the starting point that may change.


Here's a screen shot of a user.betty table. Two versions of the "testing" script are shown, one that's accessed through the default domain, and one that's accessed through mork.opml.org. The only difference is the string they return.

Here are two examples of calls:

["xmlrpc://support.opml.org:5337/RPC2"].testing ()

"5/28/06; 1:32:50 PM"

["xmlrpc://mork.opml.org:5337/RPC2"].testing ()

"mork: 5/28/2006; 1:32:52 PM"

How to install

If you're an OPML Editor user just choose the Update opml.rot command from the file menu.

If you're using Frontier or Radio, you can download the new version of the server.

# Posted by Dave Winer on 5/24/06; 11:16:37 AM - --


Ever wonder what the OPML Editor (or Radio or Frontier) is doing in the background? This script gives you a list of things you should look at.

You might find some surprises, I did.

It looks in two tables, user.scheduler.threads and user.scheduler.everyMinute.

In the first case, it lists all threads that are enabled. Ones that aren't don't run and can't use any resources. In the second case, it looks at the script, if it's in its initial state, with just a single line that's a comment, it doesn't list it.

On my system, most threads were not enabled, and the everyMinute scripts were mostly defaults, so finding the culprit was a bit of a needle in a haystack thing. Not any more. ;->

How to install

1. Download the script to your desktop.

2. Choose the Open command from the File menu, and navigate to teh file.

3. Click on OK for all confirmation prompts.

4. A window will open, click on Run. An outline will appear listing the scripts. Control-double-click (on Windows) or cmd-double-click (Mac) to visit the scripts. If there are errors, that's an indication of problems.

Caveat: This is a tool for programmers. It requires a bit of knowledge of the environment to figure out what's going on.

# Posted by Dave Winer on 5/24/06; 10:46:13 AM - --