From a894410cadb2cbbcd2f993a554bfd7924b6d6b12 Mon Sep 17 00:00:00 2001 From: Helio Loureiro Date: Fri, 30 Aug 2024 16:08:05 +0200 Subject: [PATCH] Removing myself and my profiles from TT --- mastodon-toot-thursday.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mastodon-toot-thursday.py b/mastodon-toot-thursday.py index 78f9f59..df7680f 100755 --- a/mastodon-toot-thursday.py +++ b/mastodon-toot-thursday.py @@ -5,8 +5,9 @@ import json import argparse import sys -from mastodon import Mastodon +import re import random +from mastodon import Mastodon HOME = os.getenv('HOME') @@ -40,10 +41,13 @@ def doTheLottery(self): awardedList = [] while tenPct > 0: - tenPct-=1 winner = random.choice(self.followingList) + ## skip myself + if re.search("helioloureiro", winner): + continue awardedList.append(winner) self.followingList.remove(winner) + tenPct-=1 print('Awarded:', awardedList) self.followingList = awardedList