aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-09-06 16:52:40 -0700
committerBryan Newbold <bnewbold@archive.org>2019-09-06 16:52:42 -0700
commitb2cba5cc78f9ce1e1602252e0bc3195551e09326 (patch)
tree42c2a0fad824d9c55a156f854d7d790a5d686c49
parent9f7f455e48c307ec543e7c1e40cc4a48f47424d1 (diff)
downloadchocula-b2cba5cc78f9ce1e1602252e0bc3195551e09326.tar.gz
chocula-b2cba5cc78f9ce1e1602252e0bc3195551e09326.zip
filter out bad ISSN{e,p}
Unfortunately a few hundred of these got pushed into fatcat already; will probably fix with a new fixer bot tool.
-rwxr-xr-xchocula.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/chocula.py b/chocula.py
index 04595da..12b7ae1 100755
--- a/chocula.py
+++ b/chocula.py
@@ -1175,6 +1175,11 @@ class ChoculaDatabase():
if extra['color'] == 'green':
out['is_oa'] = True
+ # filter out "NA" ISSNs
+ for k in ('issne', 'issnp'):
+ if out.get(k) and (len(out[k]) != 9 or out[k][4] != '-'):
+ out.pop(k)
+
cur = self.db.execute("SELECT * FROM homepage WHERE issnl = ?;", [issnl])
for hrow in cur:
out['any_homepage'] = True