diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-04-26 15:26:53 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-04-26 15:26:53 -0400 |
| commit | 42a9c82d7a4f2548b61d286b152387333693ba12 (patch) | |
| tree | 23d9613d200234cc245f6cf274f3c17c1ce37147 /zachwalk.py | |
| parent | 17d4fa5740e8b005f4b90fe55ba4c4b24125c07a (diff) | |
| download | zachwalk-42a9c82d7a4f2548b61d286b152387333693ba12.tar.gz | |
date: Check all link lines
(rather than just the first one with a date)
Diffstat (limited to 'zachwalk.py')
| -rwxr-xr-x | zachwalk.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/zachwalk.py b/zachwalk.py index 1588449..da03aaf 100755 --- a/zachwalk.py +++ b/zachwalk.py @@ -33,6 +33,7 @@ def getnewestdate(url): # TODO: something special if status is not 2x return gnd(fp) def gnd(fp): + nd = DEFAULT for line in fp: if type(line) != str: line=line.decode('UTF-8') @@ -40,15 +41,17 @@ def gnd(fp): desc =getdesc(line) try: date = parse(desc[0:10],fuzzy=True).date() - return date + if date > nd: + nd = date except: try: date = parse(desc,fuzzy=True).date() - return date + if date > nd: + nd = date except: pass pass - return DEFAULT + return nd def replaceDateIfNewer(desc, newestdate): try: |
