📜  xmlrpc 获取所有帖子 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:37.899000             🧑  作者: Mango

代码示例1
# get pages in batches of 20
offset = 0
increment = 20
while True:
        posts = client.call(posts.GetPosts({'number': increment, 'offset': offset}))
        if len(posts) == 0:
                break  # no more posts returned
        for post in posts:
                do_something(post)
        offset = offset + increment