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

on publishRss (adrblog=radio.weblog.init ()) {
		<<3/12/02; 3:12:19 PM by JES
			<<Implement a getUrl callback to be called by radio.weblog.writeRssFile. The callback determines the url for a given post, and returns true if the url can be determined, or false if not.
		<<1/25/02; 11:30:41 AM by JES
			<<Added a callback script, which makes radio.weblog.writeRssFile not include posts which have an flNotOnHomePage == true in the post table.
		<<1/21/02; 5:52:44 PM by DW
			<<Add support for language.
		<<1/20/02; 11:22:36 AM by DW
			<<Overhaul. Factored the guts of this routine into radio.weblog.writeRssFile.
	local (f);
	bundle { //set f
		local (pc = file.getpathchar ());
		local (partialpath = string.replaceall (adrblog^.prefs.rssFilePath, "/", pc));
		if (partialpath beginswith pc) and ( endswith pc) {
			partialpath = string.delete (partialpath, 1, 1)};
		f = + partialpath};
	local (title = adrblog^.prefs.title);
	local (link = radio.weblog.getUrl (adrblog));
	local (description = string (adrblog^.prefs.description));
	local (language = string (adrblog^.prefs.language));
	local (maxdays = adrblog^.prefs.ctDaysToDisplay);
	on callback (adrpost) { //don't include items with flNotOnHomePage == true
		if defined (adrpost^.flNotOnHomePage) {
			return (not adrpost^.flNotOnHomePage)};
		return (true)};
	on getUrlCallback (adrpost, adrurl) {
		return (radio.weblog.getUrlForPost (adrpost, adrurl, adrdata:adrblog) )};
	return (radio.weblog.writeRssFile (f, title, link, description, language, flcategories:true, maxdays:maxdays, adrcallback:@callback, adrblog:adrblog, adrGetUrlCallback:@getUrlCallback))}
<<bundle //test code
	<<local (tc = clock.ticks ())
	<<publishRss ()
	<<dialog.alert (clock.ticks () - tc)

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.