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

system.verbs.apps.blogger.testing.manilaBloggerApi.runme

<<8/24/01; 10:25:28 AM by DW
	<<This script calls a Manila website using the Blogger API.
	<<First, we create a new post. Then we edit it. If it works there should be a new item from John Q. Public at this URL:
	<<http://bloggerapitest.manilasites.com/
	<<Note that we're using a special account set up just to run these test scripts. People can test against Manila without having a Manila site. It's OK to use this info to test scripts in other environments. We want broad adoption of this API.
	<<For further explanation see this item on today's Scripting News.
	<<http://scriptingnews.userland.com/backissues/2001/08/24#manilaSupportsTheBloggerApi

window.about (); //so you can see debugging messages
local (username = "publictestaccount@nowhere.com", password = "easy2guess", blogid = "http://bloggerapitest.manilasites.com/", adrdata = @blogger.testing.manilaBloggerApi.data, postid);
local (myHelloMessage = "Hello, my name is " + user.prefs.name + ", and I am running " + (this - "system.verbs.apps.") + " to test the Blogger API running in Manila. If you see this, it's working on my machine. Dave told me to say this. \";->\"");

<<Create a new post and then edit it. If you step through it in the debugger and hit the home page in the browser between calls you should see Now is the time, etc on the home page. Take another step and it should change to myHelloMessage.
postid = blogger.newPost ("Now is the time for all good men to come to the aid of their country.", username:username, password:password, blogid:blogid, adrdata:adrdata);
blogger.editPost (myHelloMessage, postid, username:username, password:password, blogid:blogid, adrdata:adrdata);

<<Create a new post and then delete it. If you step through it in the debugger and hit the home page in the browser between calls you should see Please Delete Me on the home page. Take another step and it should disappear.
postid = blogger.newPost ("Please delete me.", username:username, password:password, blogid:blogid, adrdata:adrdata);
blogger.deletePost (postid, username:username, password:password, blogid:blogid, adrdata:adrdata)



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.