【发布时间】:2012-03-22 13:59:12
【问题描述】:
所以我正在尝试编写一个桌面应用程序来将帖子发布到 Wordpress 博客,我发现 Reuben Stanton's Wordpress XML-RPC 库(由于某种原因,他的网站没有响应,所以 here's the code on Google Code)
现在一切正常,但是当我开始发布帖子时,发生了一些奇怪的事情。
这是我的代码:
private function publish():void {
var sel:CuratorBlog=blogSelect.selectedItem;
publisher=new WPService(sel.url, sel.login, sel.password);
publisher.addEventListener(WPServiceEvent.NEW_POST, postAdded);
var p:Post=new Post();
p.dateCreated=publishDate.selectedDate;
p.title=txtTitle.text;
p.mt_keywords=txtTags.text;
p.mt_allow_comments=1;
p.mt_allow_pings=1;
p.description=htmlText; //This is obtained from a richText control. And yes, I have tested that it is being assigned properly
publisher.posts.newPost(p, true);
btnPublish.enabled=false;
cursorManager.setBusyCursor();
}
private function postAdded(e:WPServiceEvent):void {
var postId:String=(e.data as String);
Alert.show(blogSelect.selectedItem.url + "?p=" + postId);
publisher.removeEventListener(WPServiceEvent.NEW_POST, postAdded);
cursorManager.removeBusyCursor();
btnPublish.enabled=true;
}
问题是帖子已创建,但没有内容。
当我打开博客时,我可以在浏览器中看到标签和标题,但它没有内容。知道为什么吗?我该如何解决?
【问题讨论】:
标签: actionscript-3 wordpress xml-rpc