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


on serverReceiveOpml (adruser, opmltext) {
		<<12/28/09; 6:08:43 PM by DW
			<<Limit the feeds to 15 per user, for testing.
		<<12/27/09; 10:20:43 AM by DW
			<<river2Suite.subscribeFeed errors if the feed is already subscribed-to, which prevents it from being added to the user's feeds table. This was not the intent. 
		<<12/26/09; 6:03:14 PM by DW
			<<Created. Subscribe to each of the feeds, if we're not already subscribed. Add the feed to the user's feeds table. 
	local (adrdata = river2Suite.init (), feeds, adr);
	xml.rss.getOpmlFeeds (opmltext, @feeds);
	new (tabletype, @adruser^.feeds); //12/28/09 by DW
	for adr in @feeds {
		if sizeof (adruser^.feeds) < 15 { //12/28/09 by DW
			try {
				local (url = nameof (adr^));
				if not defined (adrdata^.feeds.[url]) {
					river2Suite.subscribeFeed (url)};
				local (adruserfeed = @adruser^.feeds.[url]);
				if not defined (adruserfeed^) {
					new (tabletype, adruserfeed);
					river2Suite.initUser (adruser)}}}}}; //init the user's feeds
bundle { //test code
	serverReceiveOpml (@config.river2.users.bull, scratchpad.cloudPipeOpmltext)}

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.