Wait for random interval before tooting

This commit is contained in:
Felix Ableitner 2018-09-19 00:35:22 +02:00
parent b78b1654e2
commit d43d2aa3e2

View file

@ -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()