Tuesday, March 29, 2011 at 1:07 AM.

river2Suite.userFollows

on userFollows (adruser, feedurl) {
	<<Changes
		<<3/24/11; 12:53:41 PM by DW
			<<Created. Returns true if the user follows the feed, either in the user's main feed list or in a list that he's subscribed to. 
	if defined (adruser^.feeds.[feedurl]) { //he follows, get out quick
		return (true)}
	else {
		local (adrdata = river2suite.init (), adrfeed, adrlist);
		for adrfeed in @adruser^.feeds {
			adrlist = @adrdata^.lists.[nameof (adrfeed^)];
			if defined (adrlist^) {
				if defined (adrlist^.feeds.[feedurl]) {
					return (true)}}}};
	return (false)};
bundle { //test code
	local (adruser = @config.river2.users.dave);
	dialog.alert (userfollows (adruser, "http://feeds.wnyc.org/radiolab"))}
	<<dialog.alert (userfollows (adruser, "http://static.newsriver.org/nyt/mostRecentHeadlines.xml"))



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.