summaryrefslogtreecommitdiff
path: root/scraper/s2-citation-report.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-12-16 15:02:59 +0100
committerJules Laplace <julescarbon@gmail.com>2018-12-16 15:02:59 +0100
commit110f3a34f1f36d0ea999d4aa34bbe66d5f2a01da (patch)
treef21fbeccb6a7e8d3af5d5c537ed5931ecbd62d7e /scraper/s2-citation-report.py
parent2cb31d4999649a22a0ac659a59a0aa0a0f7a241e (diff)
skip empty, pull citations again
Diffstat (limited to 'scraper/s2-citation-report.py')
-rw-r--r--scraper/s2-citation-report.py8
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)