summaryrefslogtreecommitdiff
path: root/scraper
diff options
context:
space:
mode:
Diffstat (limited to 'scraper')
-rw-r--r--scraper/compare-csv-counts.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/scraper/compare-csv-counts.py b/scraper/compare-csv-counts.py
new file mode 100644
index 00000000..fcbfe32f
--- /dev/null
+++ b/scraper/compare-csv-counts.py
@@ -0,0 +1,27 @@
+#!python
+
+import operator
+
+def read_text(fn):
+ with open(fn, 'r') as f:
+ lines = f.readlines()
+ lookup = {}
+ for line in lines:
+ line = line.strip()
+ total, fn = line.split(' ')
+ lookup[fn] = int(total)
+ return lookup
+
+new = read_text('new2.txt')
+old = read_text('new.txt')
+
+compare = {}
+for key in sorted(new.keys()):
+ if key in old:
+ diff = new[key] - old[key]
+ compare[key] = diff
+
+sorted_compare = sorted(compare.items(), key=operator.itemgetter(1))
+for key, diff in sorted_compare:
+ print("{}\t{}".format(diff, key))
+