From d43d2aa3e22fe5b745d3a3b3d5f927b3a3ce6b1c Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 19 Sep 2018 00:35:22 +0200 Subject: [PATCH] Wait for random interval before tooting --- tootbot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tootbot.py b/tootbot.py index c35aa41..3804f44 100755 --- a/tootbot.py +++ b/tootbot.py @@ -9,11 +9,16 @@ import requests import re import sqlite3 from datetime import datetime, date, time, timedelta +import time +import random if len(sys.argv) < 4: print("Usage: python3 tootbot.py twitter_account mastodon_login mastodon_passwd mastodon_instance") sys.exit(1) +sleep_time = random.randomin(0, 5 * 60) +time.sleep(sleep_time) + # sqlite db to store processed tweets (and corresponding toots ids) sql = sqlite3.connect('tootbot.db') db = sql.cursor()