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

<<8/12/01; 12:59:31 PM by DW
	<<The frontmost window contains an outline. The bar cursor line contains a post for the user's Blogger website. If it's a new post, send it to Blogger, get back the postId and attach it to the headline as an attribute. If it already has such an attribute, send an editPost message to Blogger.

local (adroutline = address (window.frontmost ()));
if typeof (adroutline^) != outlinetype {
	scriptError ("This command only works with outline windows.")};
local (atts, flEdit = false, postId = nil);
if op.attributes.getall (@atts) {
	try {
		if atts.type == "Blogger Post" {
			if defined (atts.postId) {
				postId = atts.postId;
				flEdit = true}}}};
if flEdit {
	blogger.editPost (op.getlinetext (), postId)}
else {
	local (id = blogger.newPost (op.getlinetext ()), atts);
	new (tabletype, @atts);
	atts.type = "Blogger Post";
	atts.postId = id;
	op.attributes.addgroup (@atts)}

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.