wordpress-xmlrpc: download unlimited comments
This commit is contained in:
parent
fc07af26f6
commit
736a074097
1 changed files with 4 additions and 2 deletions
|
@ -12,6 +12,8 @@ import xmlrpclib
|
||||||
|
|
||||||
from HTMLParser import HTMLParser
|
from HTMLParser import HTMLParser
|
||||||
|
|
||||||
|
MAX_POST_NO = 10000
|
||||||
|
|
||||||
class WordPress:
|
class WordPress:
|
||||||
|
|
||||||
def __init__(self, url, username, password):
|
def __init__(self, url, username, password):
|
||||||
|
@ -20,7 +22,6 @@ class WordPress:
|
||||||
self.__proxy = xmlrpclib.ServerProxy(url)
|
self.__proxy = xmlrpclib.ServerProxy(url)
|
||||||
|
|
||||||
def all_posts(self):
|
def all_posts(self):
|
||||||
MAX_POST_NO = 10000
|
|
||||||
return self.__proxy.metaWeblog.getRecentPosts("",
|
return self.__proxy.metaWeblog.getRecentPosts("",
|
||||||
self.__username,
|
self.__username,
|
||||||
self.__password,
|
self.__password,
|
||||||
|
@ -30,7 +31,8 @@ class WordPress:
|
||||||
return self.__proxy.wp.getComments("",
|
return self.__proxy.wp.getComments("",
|
||||||
self.__username,
|
self.__username,
|
||||||
self.__password,
|
self.__password,
|
||||||
{"post_id" : post["postid"]})
|
{"post_id" : post["postid"],
|
||||||
|
"number": MAX_POST_NO})
|
||||||
|
|
||||||
class MyHTMLParser(HTMLParser):
|
class MyHTMLParser(HTMLParser):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue