catch in case 'next' link isn't provided
This commit is contained in:
parent
464a3317d5
commit
dee0804188
1 changed files with 1 additions and 1 deletions
|
@ -68,7 +68,7 @@ def get_timeline(server, access_token, max):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Paginate as needed
|
# Paginate as needed
|
||||||
while len(toots) < max:
|
while len(toots) < max and 'next' in response.links:
|
||||||
response = get_toots(response.links['next']['url'], access_token)
|
response = get_toots(response.links['next']['url'], access_token)
|
||||||
toots = toots + response.json()
|
toots = toots + response.json()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|
Loading…
Reference in a new issue