@@ -27,11 +27,11 @@ def all_page_revisions(self, page_id):
2727 return self ._request ("page/{}/revisions" , page_id )
2828
2929 def page_revisions (self , page_id , * ,
30- limit = 20 , offset = 0 , direction = 'asc' ):
30+ limit , offset , direction ):
3131 data = {
32- 'limit' : limit ,
33- 'offset' : offset ,
34- 'direction' : direction ,
32+ 'limit' : 20 if limit is None else limit ,
33+ 'offset' : 0 if offset is None else offset ,
34+ 'direction' : 'asc' if direction is None else direction ,
3535 }
3636 return self ._request ("page/{}/revisions" , page_id , data )
3737
@@ -56,33 +56,44 @@ def all_forums(self):
5656 def forum (self , forum_id ):
5757 return self ._request ("forum/{}" , forum_id )
5858
59- def forum_threads (self , forum_id , * ,
60- since = None , limit = 20 , offset = 0 , direction = 'asc' ):
61- if since is None :
62- return self ._request ("forum/{}/threads" , forum_id )
63- if isinstance (since , int ):
64- data = {
65- 'timestamp' : since ,
66- 'limit' : limit ,
67- 'offset' : offset ,
68- 'direction' : direction ,
69- }
70- return self ._request ("forum/{}/since" , forum_id , data )
71- raise TypeError ("`since` must be a UNIX timestamp" )
59+ def forum_threads (self , forum_id ):
60+ return self ._request ("forum/{}/threads" , forum_id )
61+
62+ def forum_threads_since (self , forum_id , since , * ,
63+ limit , offset , direction ):
64+ if not isinstance (since , int ):
65+ raise TypeError ("`since` must be a UNIX timestamp" )
66+ data = {
67+ 'timestamp' : since ,
68+ 'limit' : 20 if limit is None else limit ,
69+ 'offset' : 0 if offset is None else offset ,
70+ 'direction' : 'asc' if direction is None else direction ,
71+ }
72+ return self ._request ("forum/{}/since" , forum_id , data )
7273
7374 def thread (self , thread_id ):
7475 return self ._request ("thread/{}" , thread_id )
7576
77+ def all_thread_posts (self , thread_id ):
78+ return self ._request ("thread/{}/posts" , thread_id )
79+
7680 def thread_posts (self , thread_id , * ,
77- since = None , limit = 20 , offset = 0 , direction = 'asc' ):
78- if since is None :
79- return self ._request ("thread/{}/posts" , thread_id )
81+ limit , offset , direction ):
82+ data = {
83+ 'limit' : 20 if limit is None else limit ,
84+ 'offset' : 0 if offset is None else offset ,
85+ 'direction' : 'asc' if direction is None else direction ,
86+ }
87+ return self ._request ("thread/{}/posts" , thread_id , data )
88+
89+ def thread_posts_since (self , thread_id , since , * ,
90+ limit , offset , direction ):
8091 if isinstance (since , int ):
8192 data = {
8293 'timestamp' : since ,
83- 'limit' : limit ,
84- 'offset' : offset ,
85- 'direction' : direction ,
94+ 'limit' : 20 if limit is None else limit ,
95+ 'offset' : 0 if offset is None else offset ,
96+ 'direction' : 'asc' if direction is None else direction ,
8697 }
8798 return self ._request ("thread/{}/since" , thread_id , data )
8899 raise TypeError ("`since` must be a UNIX timestamp" )
0 commit comments