mirror of https://gitlab.com/bashrc2/epicyon
If a publication date is not available then check the last modified date
parent
0869b6ece8
commit
0b68bb24ad
15
posts.py
15
posts.py
|
|
@ -5402,15 +5402,28 @@ def _expire_posts_for_person(http_prefix: str, nickname: str, domain: str,
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: expire_posts_for_person unable to open content ' +
|
print('EX: expire_posts_for_person unable to open content ' +
|
||||||
full_filename)
|
full_filename)
|
||||||
# Time of publication
|
|
||||||
|
# Get time of publication
|
||||||
|
published_str = ''
|
||||||
if '"published":' not in content:
|
if '"published":' not in content:
|
||||||
|
# If a publication date is not available then check the last
|
||||||
|
# modified date
|
||||||
|
if '"actor":' not in content:
|
||||||
continue
|
continue
|
||||||
|
published_str = file_last_modified(full_filename)
|
||||||
|
if not published_str:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
published_str = content.split('"published":')[1]
|
published_str = content.split('"published":')[1]
|
||||||
if '"' not in published_str:
|
if '"' not in published_str:
|
||||||
continue
|
continue
|
||||||
published_str = published_str.split('"')[1]
|
published_str = published_str.split('"')[1]
|
||||||
if not published_str.endswith('Z'):
|
if not published_str.endswith('Z'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not published_str:
|
||||||
|
continue
|
||||||
|
|
||||||
# get time difference
|
# get time difference
|
||||||
if not valid_post_date(published_str, max_age_days, debug):
|
if not valid_post_date(published_str, max_age_days, debug):
|
||||||
if keep_dms:
|
if keep_dms:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue