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

system.verbs.builtins.Frontier.tools.data.nodeTypes.rss.expand

<<Changes
	<<1/8/09; 10:05:02 AM by DW
		<<Fixed bad bad bug -- if it was opening an url in the browser (or anywhere not in the outliner) it would try to go right, fail, then delete the line. Oy!!!
	<<12/5/01; 2:34:00 PM by JES
		<<Only move the cursor after getting the expanded sub-heads, if the cursor is sitting on a node whose type is not rss.
	<<12/3/01; 5:59:20 PM by JES
		<<If the rss contains no items, do nothing. If there's an error, show it to the user in a dialog.
	<<12/1/01; 5:29:37 PM by JES
		<<If an RSS node contains no items, or can't be parsed, insert a heading saying so.
	<<12/1/01; 3:48:30 PM by JES
		<<When expanding RSS nodes, put the cursor back on the RSS node's heading, instead of leaving it on the first sub-heading.
local (url);
if op.attributes.getOne ("xmlurl", @url) {
	local (oldDisplay = op.getDisplay ());
	op.setDisplay (false);
	try {
		Frontier.tools.windowTypes.commands.openUrl (url, true);
		if op.go (right, 1) {
			op.promote ();
			op.deleteLine ();
			local (nodetype);
			op.attributes.getOne ("type", @nodetype);
			if nodetype != "rss" {
				op.go (left, 1)}}}
	else {
		dialog.alert ("Error parsing RSS: " + tryError)};
	op.setDisplay (oldDisplay)}
<<bundle //old code
	<<local (adrwindow = window.frontmost ())
	<<
	<<local (oldTarget = target.set (adrwindow))
	<<local (oldDisplay = op.getDisplay ())
	<<op.setDisplay (false)
	<<
	<<local (url)
	<<op.attributes.getOne ("xmlurl", @url)
	<<local (xmltext = tcp.httpReadUrl (url))
	<<local (localoutline)
	<<op.rssToOutline (xmltext, @localoutline)
	<<
	<<target.set (@localOutline)
	<<local (atts)
	<<op.attributes.getAll (@atts)
	<<atts.xmlUrl = url
	<<op.go (right, 1)
	<<editMenu.selectAll ()
	<<op.reorg (left, 1)
	<<op.go (up, 1)
	<<op.deleteline ()
	<<
	<<target.set (adrwindow)
	<<op.attributes.addGroup (@atts)
	<<op.insertoutline (@localoutline, right)
	<<if date.versionLessThan (Frontier.version (), "7.0b13")
		<<op.go (left, 1)
	<<
	<<op.setDisplay (oldDisplay)
	<<try {target.set (oldTarget)}



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.