some debug output to log activity

This commit is contained in:
cquest 2022-11-06 09:31:06 +01:00
parent 5a8dabf974
commit e453665420

View File

@ -75,9 +75,13 @@ except:
sys.exit(1) sys.exit(1)
print(source)
print("---------------------------")
if source[:4] == 'http': if source[:4] == 'http':
d = feedparser.parse(source) d = feedparser.parse(source)
twitter = None twitter = None
print(len(d.entries))
for t in reversed(d.entries): for t in reversed(d.entries):
# check if this tweet has been processed # check if this tweet has been processed
if id in t: if id in t:
@ -147,6 +151,7 @@ else:
d = json.load(open('tweets.json','r')) d = json.load(open('tweets.json','r'))
twitter = source twitter = source
print(len(d))
for t in reversed(d): for t in reversed(d):
c = html.unescape(t['tweet']) c = html.unescape(t['tweet'])
# do not toot twitter replies # do not toot twitter replies
@ -249,3 +254,4 @@ else:
db.execute("INSERT INTO tweets VALUES ( ? , ? , ? , ? , ? )", (id, toot["id"], source, mastodon, instance)) db.execute("INSERT INTO tweets VALUES ( ? , ? , ? , ? , ? )", (id, toot["id"], source, mastodon, instance))
sql.commit() sql.commit()
print()