MetaWeblogApi.getRecentPosts (blogid, username, password, numberOfPosts)
metaWeblog.getRecentPosts returns a list of the most recent posts in the system

  • Parameter blogid:
    String
  • Parameter username:
    String
  • Parameter password:
    String
  • Parameter numberOfPosts:
    int, default 20
  • Returns
    Array of Objects representing Blog Entries with the following properties .userid String .postid String .dateCreated Date .title String .description String containing the body of this entry (Note: this used to be .content in the BLOGGER-API) .link String .permaLink String, equals .link .mt_excerpt String [MT-API] .mt_text_more String [MT-API] .mt_allow_comments int, 0=no, 1=yes [MT-API] .mt_allow_pings int, 0=no, 1=yes [MT-API] .mt_convert_breaks String [MT-API] .mt_keywords String [MT-API] .antville_blogid String
Sourcecode in MetaWeblogApi/metaWeblogAPI.js:
1:   function getRecentPosts(blogid, username, password, numberOfPosts) {
2:      var usr = root.blogger.getUser(username, password);
3:      var blog = root.blogger.getBlog(blogid.toString());
4:      if (!blog)
5:         throw("Couldn't find the blog " + blogid);
6:      var level = blog.members.getMembershipLevel(usr);
7:      try {
8:         blog.checkView(usr, level);
9:      } catch (deny) {
10:        throw("You're not allowed to view the blog " + blogid);
11:     }
12:  
13:     var size = blog.stories.size();
14:     var limit = Math.min(numberOfPosts ? Math.min(numberOfPosts, 20) : 20, size);
15:     var posts = new Array();
16:     var idx = 0;
17:     while (posts.length < limit && idx < size) {
18:        var entry = blog.stories.get(idx++);
19:        try {
20:           entry.checkEdit(usr, level);
21:        } catch (deny) {
22:           continue;
23:        }
24:        posts[posts.length] = this.convertStoryToStruct(entry);
25:     }
26:     return posts;
27:  }