Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.weblog.metaWeblogApi.rpcHandlers.editPost
on editPost (postid, username, password, struct, publish) {
<<Changes
<<3/13/02; 8:11:48 PM by DW
<<Created.
on neuter (s) {
return (radio.weblog.bloggerApi.neuterMacros (s))};
radio.weblog.bloggerApi.checkUser (client, true, username, password);
local (adrblog = radio.weblog.init ());
local (adrpost = @adrblog^.posts.[string.padwithzeros (postid, 8)]);
local (posttext = neuter (struct.description));
radio.weblog.post (posttext, adrpost:adrpost);
radio.weblog.metaWeblogApi.copyFromStruct (@struct, adrpost);
if publish {
radio.weblog.metaWeblogApi.publishPost (adrpost)};
return (true)}
<<bundle //test code
<<local (struct, client = "127.0.0.1")
<<bundle //set up struct
<<new (tabletype, @struct)
<<struct.title = "Playing with a new API"
<<struct.link = "http://radio.userland.com/emulatingBloggerInRadio"
<<struct.description = string.upper ("Now that we have Links and Titles, everyone wants an XML-RPC interface that includes that. If all goes well, we should have such an interface that does that, and a bunch more.")
<<editPost (1060, user.radio.prefs.security.remoteUsername, user.radio.prefs.security.remotePassword, struct, 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.