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

system.verbs.apps.metaWeblog.newPost

on newPost (title="", link="", description="", adrstruct=nil, username=nil, password=nil, blogId=nil, flPublish=true, adrdata=@metaweblog.data) {
	<<Changes
		<<11/23/05; 3:39:02 PM by DW
			<<blogId must be a string.
		<<6/9/02; 11:34:06 AM by DW
			<<Created. See the server-side at radio.weblog.metaweblogapi.
	local (url, struct);
	metaWeblog.init ();
	bundle { //set defaults
		if username == nil {
			username = user.metaWeblog.username};
		if password == nil {
			password = string (user.metaWeblog.password)};
		if blogId == nil {
			blogId = user.metaWeblog.blogId}};
	url = "xmlrpc://" + adrdata^.server + ":" + adrdata^.port + adrdata^.rpcPath;
	if adrstruct == nil {
		adrstruct = @struct;
		new (tabletype, adrstruct)};
	if title != "" {
		adrstruct^.title = title};
	if link != "" {
		adrstruct^.link = link};
	adrstruct^.description = description; //description must be present, according to the Radio implementation
	return ([url].metaWeblog.newPost (string (blogid), username, password, adrstruct^, flPublish))}
<<bundle //test code
	<<local (struct)
	<<new (tabletype, @struct)
	<<struct.categories = {"Michegas", "Mind Bombs"}
	<<dialog.alert (newPost (description:"Now is the time for all good men to come to the aid of their country.", link:"http://www.scripting.com/", title:"Test Post for Metaweblog API glue", adrstruct:@struct))



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.