Monday, November 08, 2010 at 12:05 AM.

	<<3/25/02; 5:50:21 PM by JES
local (url = "http://");
if dialog.ask ("Enter the URL of an outline to subscribe to:", @url) {
	if not (url beginsWith "http://") {
		url = "http://" + url};
	local (adrdata = radio.outliner.init ());
	local (author = "Anonymous");
	local (adrsubscription = @adrdata^.subscriptions.[url]);
	if defined (adrsubscription^) {
		frontier.bringtofront ();
		radio.outliner.openBuddies (true, true);
	<<bundle //factored code
		<<local (localoutline)
			<<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^
			<< (url, @localoutline)
			<<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 = ()
		<<adrsubscription^.whenLastPoll = date (0)
		<<radio.outliner.openBuddies (true)
	radio.outliner.subscribeUrl (url, author)}

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.