From 17d4fa5740e8b005f4b90fe55ba4c4b24125c07a Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Tue, 26 Apr 2022 15:18:41 -0400 Subject: date parsing: Better accept standard subscribable pages spec --- zachwalk.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'zachwalk.py') diff --git a/zachwalk.py b/zachwalk.py index 145c174..1588449 100755 --- a/zachwalk.py +++ b/zachwalk.py @@ -37,13 +37,16 @@ def gnd(fp): if type(line) != str: line=line.decode('UTF-8') if line.strip()[0:2] == '=>': + desc =getdesc(line) try: - desc =getdesc(line) - desc=desc.split(':')[0] #this should only have 1 'datey' part - date = parse(desc,fuzzy=True).date() - # todo: read lots of these and compare them + date = parse(desc[0:10],fuzzy=True).date() return date except: + try: + date = parse(desc,fuzzy=True).date() + return date + except: + pass pass return DEFAULT -- cgit 1.4.1