fix: Fix logging issue and convert status ID to string TUN-45
This commit is contained in:
parent
ab4ba9b75c
commit
ac02e46203
@ -165,11 +165,11 @@ def run(instance, access_token, fanfou_cookie, fanfou_token):
|
|||||||
if str(status['id']) not in posted_ids:
|
if str(status['id']) not in posted_ids:
|
||||||
content = status['content'].replace('<br />', '\n')
|
content = status['content'].replace('<br />', '\n')
|
||||||
content = re.sub('<.*?>', '', content)
|
content = re.sub('<.*?>', '', content)
|
||||||
logger.info(status['id'] + ' ' + content)
|
logger.info(str(status['id']) + ' ' + content)
|
||||||
post_fanfou(fanfou_cookie, fanfou_token, content, status['media_attachments'])
|
post_fanfou(fanfou_cookie, fanfou_token, content, status['media_attachments'])
|
||||||
with open(last_id_file, 'a') as f:
|
with open(last_id_file, 'a') as f:
|
||||||
f.write(str(status['id']) + '\n')
|
f.write(str(status['id']) + '\n')
|
||||||
posted_ids.append(status['id'])
|
posted_ids.append(str(status['id']))
|
||||||
logger.info('write toot %s', status['content'])
|
logger.info('write toot %s', status['content'])
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
# update min_id
|
# update min_id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user