BloggerApi.editPost (appkey, postid, username, password, content, publish)
blogger.editPost updates information about an existing post

  • Parameter appkey:
    String
  • Parameter postid:
    String
  • Parameter username:
    String
  • Parameter password:
    String
  • Parameter content:
    String
  • Parameter publish:
    int, 0=no, 1=yes
  • Returns
    Boolean true if successful
Sourcecode in BloggerApi/bloggerAPI.js:
1:   function editPost(appkey, postid, username, password, content, publish) {
2:      var usr = root.blogger.getUser(username, password);
3:      var entry = root.storiesByID.get(postid.toString());
4:      if (!entry)
5:         throw("Couldn't find the entry with id " + postid);
6:      // check if user is allowed to edit the entry
7:      try {
8:         entry.checkEdit(usr, entry.site.members.getMembershipLevel(usr));
9:      } catch (deny) {
10:        throw ("You're not allowed to edit the entry with id " + postid);
11:     }
12:     var param = new Object();
13:     root.blogger.parseBloggerAPIPosting(param, content);
14:     entry.title = param.content_title;
15:     entry.content.setProperty("title", param.content_title);
16:     entry.content.setProperty("text", param.content_text);
17:     entry.online = publish ? 2 : 0;
18:     entry.modifier = usr;
19:     entry.modifytime = new Date();
20:     entry.site.lastupdate = entry.modifytime;
21:     return true;
22:  }