benbu...@gmail.com
unread,May 31, 2013, 1:34:22 PM5/31/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tumbl...@googlegroups.com
Hi,
I'm new to the API and I've run into something a little confusing.
The response to /posts or /info contains an item which is listed as the "total number of posts to this blog." It looks like this is just the number of published posts (not including private posts), but the body "posts" object contains both published and private posts. So, when I'm processing the response to a /posts request: response['blog']['posts'] != response['posts'].length (even accounting for limit/offset/pagination).
Example on a blog with 3 private posts:
- 47 total posts reported in 'info' response
- using limit of 20 and offsets: 0,20,40
- Response for offset 0 : 'posts' object contains 20 posts, 0 are private
- Response for offset 20 : posts' object contains 20 posts, 3 are private
- Response for offset 40 : 'posts' object contains 10 posts, 0 are private
- Total posts returned: 50
My questions:
- Is there a way to get the count of private posts on a blog (other than by calculation)?
- Or is there a way to get the total number of published+private posts (other than by calculation)?
- Or is there a way to get the most recent post id on a blog (other than by getting the posts)?
- Or most importantly, what's The Right Way to get all the published and private posts on a blog? I've got something like: keep increasing the offset by the limit until you get zero results?
Thanks,
Ben