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

system.verbs.builtins.radio.prefs.browseHttpFile

on browseHttpFile (url, ctCacheSeconds=3600, flNeuterMacros=true) {
	<<Changes
		<<2/5/02; 11:45:03 AM by PBS
			<<Conditionalized to work in Frontier.
		<<11/23/01; 12:25:25 PM by DW
			<<Created. Reads an OPML file via HTTP and runs it through the browser.
	local (flread = true, adrincache);
	bundle { //set flread, adrincache
		if not defined (system.temp.radio) { //PBS 02/05/02: this table may not exist in Frontier
			new (tableType, @system.temp.radio)};
		local (adrcache = @system.temp.radio.outlineCache);
		if not defined (adrcache^) {
			new (tabletype, adrcache)};
		adrincache = @adrcache^.[url];
		if defined (adrincache^) {
			if (clock.now () - timeModified (adrincache)) < ctCacheSeconds {
				flread = false}}};
	if flread {
		local (xmltext = tcp.httpReadUrl (url));
		if flNeuterMacros {
			if system.environment.isRadio { //PBS 02/05/02: conditionalized to work in Frontier
				xmltext = string.replaceall (xmltext, "<%", "<%")}
			else {
				xmltext = string.replaceall (xmltext, "{", "{")}};
		op.xmltooutline (xmltext, adrincache);
		settimemodified (adrincache, clock.now ())};
	return (radio.prefs.browser (adrincache))}
<<bundle //test code
	<<browseHttpFile ("http://radio.weblogs.com/0001015/gems/todolist.opml")



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.