Closed GoogleCodeExporter closed 8 years ago
hi
I would request a response to the above question since I have an urgent
deadline coming up for a client. Thanks in advance
Original comment by satyavr...@gmail.com
on 9 Dec 2011 at 2:43
[deleted comment]
You will have to do paging using start and count parameters. e.g. The following
example reads 10 posts per request.
int total = 0;
Posts posts = client.getPostsByGroup(idValue, 0, 10);
while (total < posts.getTotal()) {
total += posts.getCount();
// consume posts
posts = client.getPostsByGroup(idValue, (int) (posts.getStart() + posts.getCount()), 10);
}
Original comment by nabeelmukhtar
on 20 Dec 2011 at 7:58
Thanks, Nabeel. However, my issue is that the getPostsByGroup correctly
retrieves all the posts from a group. However, in order to examine the
individual posts, I need to call getPostList on this Posts object. I cannot
make getPostList retrieve more than 10 rows at a time.
Is this the intended behavior? If it is, I will change the way my code is
structured but I wanted to check with you before I changed the code
thanks
Original comment by satyavr...@gmail.com
on 20 Dec 2011 at 8:18
You can specify a count of greater than 10. e.g. to get 20 rows each time
List<Post> allPosts = new ArrayList<Post>();
int total = 0;
Posts posts = client.getPostsByGroup(idValue, 0, 20);
while (total < posts.getTotal()) {
total += posts.getCount();
allPosts.addAll(posts.getPostList());
posts = client.getPostsByGroup(idValue, (int) (posts.getStart() + posts.getCount()), 20);
}
Original comment by nabeelmukhtar
on 20 Dec 2011 at 8:59
Original issue reported on code.google.com by
woostersoz
on 19 Nov 2011 at 9:05