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

on viewFavoriteWeblogs (pretext="", posttext="") {
		<<2/21/02; 6:58:49 PM by DW
			<<Allow the caller to specify pretext and posttext optional parameters.
		<<2/20/02; 7:29:56 PM by DW
			<<Frank McPherson gave me this idea. We know what your favorite weblogs are, and we know when they updated. So why not have an easy way to include that in your home page template? That's what this macro does.
	local (adrdata = weblogsCom.init ());
	local (htmltext = "", indentlevel = 0);
	on add (s) {
		htmltext = htmltext + (string.filledstring ("\t", indentlevel) + s + "\r\n");};
	local (i, name, adr);
	add ("<table cellspacing=\"5\" cellpadding=\"0\">"); indentlevel++;
	for i = sizeof (adrdata^.changes) downto 1 {
		adr = @adrdata^.changes [i];
		name = nameof (adr^);
		if defined (adrdata^.favorites.[name]) {
			local (adrlog = @adrdata^.weblogs.[name]);
			local (day, month, year, hour, minute, second);
			date.get (adr^, @day, @month, @year, @hour, @minute, @second);
			add ("<tr><td>" + pretext + "<a href=\"" + adrlog^.url + "\">" + name + "</a> " + posttext + "</td><td align=\"right\">" + pretext + date.hourtostring (hour) + posttext + "</td></tr>")}};
	add ("</table>"); indentlevel--;
	return (htmltext)}

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.