Wikipedia talk:SOPA initiative/Congress data/links

Code for regenerating from https://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/CongressLookup/data/cl_house.sql?view=co
 * 1) !/usr/bin/python

import os import sys import re

if len(sys.argv)>0: for arg in sys.argv[1:]: f = open(arg) for line in f:           # 1       2          3    4                               5       6     7    8               9               10                          11 #(400314, 'P000197', 'F', 'Rep. Nancy Pelosi [D, CA-8]', 'Rep.', 'CA', '8', '202-225-4965', '202-225-8259', 'https://pelosi.house.gov/contact/email-me.shtml', 'nancypelosi'), m = re.match(r"\((\d+), '([^']*)', '([^']*)', '([^']*)', '([^']*)', '([^']*)', '([^']*)', '([^']*)', '([^']*)', '([^']*)', (NULL|'[^']*')\)[,;]", line) if(m): print "* [" + m.group(10) + " " + m.group(4) + "]" #m = re.sub(old, new, line.strip) #print line else: print "oops!"