File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -177,15 +177,21 @@ def get_posts(self, thread_id):
177
177
post_id = None
178
178
raw_message = None
179
179
try :
180
+ """ Returns a Paginator object that matches the desired criteria:
181
+ `self.disqus.api.posts.list`: Returns a list of posts ordered by the date created.
182
+ `forum`: Looks up a forum by short name.
183
+ `thread`: Looks up a thread by ID. Filters results returned from `self.disqus.api.posts.list`
184
+ and returns only those which match `forum` and `thread`.
185
+ """
180
186
paginator = disqusapi .Paginator (self .disqus .api .posts .list ,
181
187
forum = FORUM ,
182
188
thread = thread_id ,
183
- order = 'asc' , method = 'GET' )
189
+ order = 'asc' )
184
190
if paginator :
185
- for result in paginator :
186
- if result ['author' ]['name' ] == self .user ['username' ] and result ['author' ]['url' ] == AUTHOR_URL :
187
- post_id = result ['id' ]
188
- raw_message = result ['raw_message' ]
191
+ for post in paginator :
192
+ if post ['author' ]['name' ] == self .user ['username' ] and post ['author' ]['url' ] == AUTHOR_URL :
193
+ post_id = post ['id' ]
194
+ raw_message = post ['raw_message' ]
189
195
break
190
196
except Exception as error :
191
197
print 'Error:' , error
You can’t perform that action at this time.
0 commit comments