diff --git a/get_context.py b/get_context.py index ef507c9..0ffec3c 100644 --- a/get_context.py +++ b/get_context.py @@ -68,7 +68,7 @@ def get_timeline(server, access_token, max): ) # 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) toots = toots + response.json() except Exception as ex: