diff options
Diffstat (limited to 'scraper/s2-citation-report.py')
| -rw-r--r-- | scraper/s2-citation-report.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scraper/s2-citation-report.py b/scraper/s2-citation-report.py index fc52cc35..e0d812d7 100644 --- a/scraper/s2-citation-report.py +++ b/scraper/s2-citation-report.py @@ -6,7 +6,6 @@ import math import operator import click import subprocess -#import builder from util import * DIR_PUBLIC_CITATIONS = "../site/datasets/citations" @@ -33,12 +32,17 @@ def s2_citation_report(): print("citations: {}".format(paper_count)) print("geocoded: {} ({}%)".format(geocode_count, percent(geocode_count, paper_count))) + # fetch_google_sheet + sts = subprocess.call([ "s3cmd", "sync", DIR_PUBLIC_CITATIONS + '/', "s3://megapixels/v1/citations/", ]) +def write_master_report(fn, title, papers, key): + keys, rows = fetch_google_sheet('statistics') + def write_papers_report(fn, title, papers, key, reverse=False): sorted_papers = [] for paper in sorted(papers, key=lambda x: x[key], reverse=reverse): @@ -154,7 +158,7 @@ def process_paper(row, addresses, success): pdf_count += 1 if has_doi: doi_count += 1 - if citation.data is None: + if citation is None or citation.data is None: print("Citation missing! {}".format(cite['paperId'])) continue institutions = load_institutions(citationId) |
