From dee0804188956a317333edb20da37a9a2b641fe3 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 9 Mar 2023 07:26:31 +0000 Subject: [PATCH] catch in case 'next' link isn't provided --- get_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: