diff options
Diffstat (limited to 's2-doi-report.py')
| -rw-r--r-- | s2-doi-report.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/s2-doi-report.py b/s2-doi-report.py index 8be76192..d2facb92 100644 --- a/s2-doi-report.py +++ b/s2-doi-report.py @@ -98,7 +98,9 @@ def load_ieee(paper_id, fn): print('could not read data') return [] affiliations = [ author['affiliation'] for author in data['authors'] ] + institutions = [ [ paper_id, author['affiliation'], author['affiliation'] ] for author in data['authors'] ] # print(affiliations) + write_json('{}/{}'.format(paper_path(paper_id), 'institutions.json'), { 'institutions': institutions }) return affiliations def load_geocode_lookup(): @@ -110,23 +112,14 @@ def load_geocode_lookup(): lookup[inst[3]] = True return lookup -class NameLine(object): - def __init__(self, s): - self.s = s.strip() - def __str__(self): - return '<span class="name">' + self.s + '</span>' - -class BoldLine(object): - def __init__(self, s): - self.s = s.strip() - def __str__(self): - return '<b>' + self.s + '</b>' - def find_authors(authors, line): for a in authors: if a[2] in line: return a return None +def paper_path(paper_id): + return '{}/{}/{}'.format(DOI_DIR, paper_id[0:2], paper_id) + if __name__ == '__main__': doi_report() |
