summaryrefslogtreecommitdiff
path: root/scraper/s2-search.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-12-16 13:40:28 +0100
committerJules Laplace <julescarbon@gmail.com>2018-12-16 13:40:28 +0100
commit797b10edaf276305c2b64b25a564c4bdea21f555 (patch)
tree3040270c2304ac2871f06deb7240e44cb39af35c /scraper/s2-search.py
parent7ade5fb2b8826725a63853d8906b17c0091e4707 (diff)
datasetsss
Diffstat (limited to 'scraper/s2-search.py')
-rw-r--r--scraper/s2-search.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scraper/s2-search.py b/scraper/s2-search.py
index e943053a..9ec20cc9 100644
--- a/scraper/s2-search.py
+++ b/scraper/s2-search.py
@@ -25,7 +25,8 @@ totalResults
@click.command()
@click.option('--index', '-n', default=0, help='Index of CSV (query,)')
-def fetch_entries(index):
+@click.option('--refresh/--no-refresh', '-f', help='Force it to query the paper API again')
+def fetch_entries(index, refresh):
keys, lines = read_citation_list(index)
citation_lookup = []
s2 = SemanticScholarAPI()
@@ -39,7 +40,7 @@ def fetch_entries(index):
dump_fn = './datasets/s2/dumps/{}.json'.format(key)
entry_fn = './datasets/s2/entries/{}.json'.format(key)
result = None
- if os.path.exists(entry_fn):
+ if not refresh and os.path.exists(entry_fn):
result = read_json(entry_fn)
else:
results = s2.search(clean_title)