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

on setTemplate (appkey, blogid, username, password, template, templateType) {
		<<1/22/02; 6:38:04 PM by DW
	local (templatename);
	radio.weblog.bloggerApi.checkUser (client, true, username, password);
	radio.weblog.bloggerApi.checkBlogid (blogid);
	case string.lower (templateType) {
		"main" {
			templatename = "template"};
		"archiveindex" {
			scriptError ("Can't get the archiveIndex template because Radio sites do not have an archiveIndex template.")}}
	else { //error -- the template doesn't exist
		scriptError ("Can't get the " + templateType + " template because it doesn't exist.")};
	local (f = + "#" + templatename + ".txt");
	file.surefilepath (f);
	file.writetextfile (f, string (template));
	return (true)}

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.