!!! getThreadList length MAX 20
This commit is contained in:
@@ -550,26 +550,21 @@ class Client(object):
|
|||||||
return list(reversed(messages))
|
return list(reversed(messages))
|
||||||
|
|
||||||
|
|
||||||
def getThreadList(self, start, end=None):
|
def getThreadList(self, start, length=20):
|
||||||
"""Get thread list of your facebook account.
|
"""Get thread list of your facebook account.
|
||||||
|
|
||||||
:param start: the start index of a thread
|
:param start: the start index of a thread
|
||||||
:param end: (optional) the last index of a thread
|
:param end: (optional) the last index of a thread
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# deprecated
|
assert length < 21, '`length` is deprecated, max. last 20 threads are returned'
|
||||||
# end does not limit the length of the returned threads
|
|
||||||
# if not end: end = start + 20
|
|
||||||
# if end <= start: end = start + end
|
|
||||||
|
|
||||||
assert end is None, '`end` is deprecated, always return last 20 threads'
|
|
||||||
|
|
||||||
timestamp = now()
|
timestamp = now()
|
||||||
date = datetime.now()
|
date = datetime.now()
|
||||||
data = {
|
data = {
|
||||||
'client' : self.client,
|
'client' : self.client,
|
||||||
'inbox[offset]' : start,
|
'inbox[offset]' : start,
|
||||||
'inbox[limit]' : 19,
|
'inbox[limit]' : length,
|
||||||
}
|
}
|
||||||
|
|
||||||
r = self._post(ThreadsURL, data)
|
r = self._post(ThreadsURL, data)
|
||||||
|
Reference in New Issue
Block a user