mirror of
https://github.com/cquest/tootbot.git
synced 2025-02-17 08:18:07 +00:00
some debug output to log activity
This commit is contained in:
parent
5a8dabf974
commit
e453665420
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user