]> khamidou — GitHub mirrors - rfcspot.git/commitdiff
a basic script to build an index.
authorKarim Hamidou <karim@MacBook.local>
Tue, 9 Feb 2016 04:48:33 +0000 (20:48 -0800)
committerKarim Hamidou <karim@MacBook.local>
Tue, 9 Feb 2016 04:48:33 +0000 (20:48 -0800)
src/build-index.py [new file with mode: 0644]

diff --git a/src/build-index.py b/src/build-index.py
new file mode 100644 (file)
index 0000000..76bbd59
--- /dev/null
@@ -0,0 +1,26 @@
+# This script reads a stackoverflow post archive
+# and creates a table of questions related to RFCs.
+# Stages: 1. build table of questions
+#         2. Go through every question & answer to find RFC references
+#         3. Link the question and the RFC number together
+#         4. Dump the result to a file.
+import sys
+import lxml
+from collections import defaultdict
+
+questions_table = defaultdict([])
+
+xml_tree = None
+def load_posts_file(filename):
+    global xml_tree
+
+
+def main():
+    if len(sys.argv) != 2:
+        print "usage: build-index Posts.xml"
+
+    load_posts_file(sys.argv[1])
+
+if __name__ == '__main__':
+    main()
+