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

	<<11/5/02; 11:31:07 AM by DW
		<<Add support for templates.
	<<10/10/02; 11:22:46 AM by DW
		<<Created. Because <descriptions> in RSS can contain HTML markup, the emails must go out with a mimetype of text/html, unless we're going to write a heroic parser to clean up the text. 
if {
	local (htmltext = "", indentlevel = 0);
	on add (s) {
		htmltext = htmltext + (string.filledstring ("\t", indentlevel) + s + "\r\n");};
	local (adrservice, adritem, dashes = string.filledstring ("-", 70), ct = 1);
	for adrservice in {
		add (string.replace (string (, "<%title%>", adrservice^.title));
		for adritem in @adrservice^.items {
			local (s = string (;
			s = string.replace (s, "<%count%>", ct++);
			s = string.replace (s, "<%title%>", adritem^.title);
			add (s)}};
			<<add ("<tr><td align=\"right\" valign=\"top\">" + ct++ + ". </td><td>" + adritem^.title + "</td></tr>")
	local (mailtext = string (;
	mailtext = string.replace (mailtext, "<%bodytext%>", htmltext);
	mailtext = string.replace (mailtext, "<%username%>",;
	tcp.sendmail (,, mailtext,, mimeType:"text/html")}

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.