summaryrefslogtreecommitdiff
path: root/fetch-entries.py
diff options
context:
space:
mode:
Diffstat (limited to 'fetch-entries.py')
-rw-r--r--fetch-entries.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/fetch-entries.py b/fetch-entries.py
new file mode 100644
index 00000000..b8279a1a
--- /dev/null
+++ b/fetch-entries.py
@@ -0,0 +1,25 @@
+import os
+import sys
+import csv
+import subprocess
+
+with open('./datasets/citations.csv', 'r') as f:
+ reader = csv.reader(f)
+ lines = list(reader)
+ keys = lines[0]
+ lines = lines[1:]
+
+print([line[1] for line in lines])
+
+for line in lines:
+ label = line[0]
+ title = line[1]
+ entries_fn = './datasets/scholar/entries/{}.csv'.format(title)
+ print(entries_fn)
+ if not os.path.exists(entries_fn):
+ with open(entries_fn, 'w') as f:
+ subprocess.call([
+ './vendor/scholar.py',
+ '-t', '-s', title, '--csv',
+ ], stdout=f)
+ sys.exit(1)