Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.outliner.subscribeUrl
on subscribeUrl (url, author="Anonymous", flOpenBuddies=true, flBringToFront=false) {
<<Changes
<<3/29/02; 1:36:22 AM by JES
<<Created. Factored from radio.outliner.menuCommands.subscribeToOutline.
local (adrdata = radio.outliner.init ());
local (adrsubscription = @adrdata^.subscriptions.[url]);
local (localoutline);
try {
try { //to get the author from the OPML
local (adrincache = radio.outliner.preCacheUrl (url));
local (xstruct);
xml.compile (adrincache^.xmltext, @xstruct);
local (nomad = xml.getAddress (@xstruct, "opml"));
nomad = xml.getAddress (nomad, "head");
nomad = xml.getAddress (nomad, "ownerName");
author = nomad^};
radio.outliner.read (url, @localoutline)}
else {
scriptError ("Can't subscribe to the outline because there was an error reading it. \"" + tryerror + "\".")};
new (tabletype, adrsubscription);
adrsubscription^.author = author;
<<adrsubscription^.outline = localoutline
adrsubscription^.whenCreated = clock.now ();
adrsubscription^.whenLastPoll = date (0);
radio.outliner.openBuddies (flOpenBuddies, flBringToFront)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.