Compare commits
2 Commits
b6c0f3bfef
...
0bf1d379e8
Author | SHA1 | Date |
---|---|---|
Gitea | 0bf1d379e8 | |
Gitea | 7ba769b78a |
|
@ -0,0 +1,5 @@
|
|||
log
|
||||
data
|
||||
__pycache__
|
||||
nohup.out
|
||||
settings.py
|
12
main.py
12
main.py
|
@ -57,8 +57,9 @@ def main():
|
|||
pubdate = datetime.now(pubdate.tzinfo) # Fix later pubdate is not defined
|
||||
if pubdate > datetime.now(pubdate.tzinfo) - timedelta(days=5):
|
||||
if not line in send_data:
|
||||
result = api.status_post(
|
||||
(title + "\n\n" + item['link']),
|
||||
try:
|
||||
result = api.status_post(
|
||||
(title + "\n\n Source: " + item['link']),
|
||||
reply_id, #in_reply_to_id
|
||||
None, #media_ids
|
||||
False, #sensitive
|
||||
|
@ -70,8 +71,11 @@ def main():
|
|||
None, #scheduled_at
|
||||
None, #poll
|
||||
None, #quote_id
|
||||
)
|
||||
if result.id:
|
||||
)
|
||||
except Exception as exception:
|
||||
result = False
|
||||
print("err: (" + type(exception).__name__ + ") " + title + item['link'])
|
||||
if result and result.id:
|
||||
if not reply_id:
|
||||
reply_id = result.id
|
||||
visibility = 'unlisted'
|
||||
|
|
Loading…
Reference in New Issue