From 60488410a864a04312be1b084745125da078ae18 Mon Sep 17 00:00:00 2001 From: Sebb Date: Sun, 30 Jul 2023 12:59:42 +0100 Subject: [PATCH] Allow easy disabling of twitter processing --- plugins/asfdata.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/asfdata.py b/plugins/asfdata.py index 1c98f6f..d610980 100644 --- a/plugins/asfdata.py +++ b/plugins/asfdata.py @@ -584,6 +584,12 @@ def connect_to_endpoint(url, headers): def process_twitter(handle, count, debug): if debug: print(f'-----\ntwitter feed: {handle}') + # Disable processing if count <= 0 + if count <= 0: + print('WARN: Twitter disabled; count <= 0') + return sequence_list('twitter',[{ + 'text': 'Twitter processing is disabled (count <= 0)' + }]) bearer_token = twitter_auth() if not bearer_token: print('WARN: no bearer token for Twitter')