diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-04-26 15:18:41 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-04-26 15:18:41 -0400 |
| commit | 17d4fa5740e8b005f4b90fe55ba4c4b24125c07a (patch) | |
| tree | 200d1cff7336896ada972abe9835e8bfd286f970 /zachwalk.py | |
| parent | 5e2cc3f54ac2daa81faa3fd5a0e611ac4f88f3e8 (diff) | |
| download | zachwalk-17d4fa5740e8b005f4b90fe55ba4c4b24125c07a.tar.gz | |
date parsing: Better accept standard subscribable pages spec
Diffstat (limited to 'zachwalk.py')
| -rwxr-xr-x | zachwalk.py | 11 |
1 files changed, 7 insertions, 4 deletions
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 |
