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


on loadOpmlArchive (username) {
		<<5/29/10; 9:26:17 AM by DW
	local (adrdata = scripting2Suite.initUser (username));
	local (adrcal = @system.temp.scripting2.[username].calendar);
	if not defined (adrcal^) {
		local (folder = adrdata^.prefs.opmlfolder, pc = file.getpathchar (), f, relpath);
		file.surefilepath (folder + "xxx"); //make sure the folder exists
		new (tabletype, adrcal);
		fileloop (f in adrdata^.prefs.opmlfolder, infinity) {
			relpath = f - adrdata^.prefs.opmlfolder;
			if string.countfields (relpath, pc) == 3 {
				try {
					local (year, month, day, when, adrday);
					year = number (string.nthfield (relpath, pc, 1));
					month = number (string.nthfield (relpath, pc, 2));
					day = number (string.nthfield (relpath, pc, 3) - ".opml");
					when = date.set (day, month, year, 0, 0, 0);
					adrday = mainresponder.calendar.getDayAddress (adrcal, when);
					adrday^.f = f}}}};
					<<msg (relpath)
	return (adrcal)};
bundle { //test code
	local (adrcal);
	adrcal = loadOpmlArchive ("davewiner");
	edit (adrcal)}

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.