This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
import cookielib | |
from BeautifulSoup import BeautifulSoup | |
uri = "http://b3.caspio.com/dp.asp?appSession=718251683844642" | |
class PrettifyHandler(mechanize.BaseHandler): | |
""" | |
Shamelessly stolen from this stackoverflow answer: | |
http://stackoverflow.com/questions/1782368/is-it-possible-to-hook-up-a-more-robust-html-parser-to-python-mechanize/5039584#5039584 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To use, include jQuery, qTip plugin and DocumentCloud embed javascript. | |
The script looks for anchor tags with hrefs to DocumentCloud notes. | |
*/ | |
$(document).ready(function(){ | |
$('a[href^="https://www.documentcloud.org/"]').each(function(){ | |
var myRE = /https:\/\/www\.documentcloud\.org\/documents\/(\d+).+\/a(\d+)/; | |
var embedIDs = myRE.exec($(this).attr('href')); | |
if (embedIDs.length === 3) { | |
$(this).click(function(event){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32com.client as win32 | |
from glob import glob | |
import re | |
# Grab all the .Doc files from these two | |
# directories so we can open them with win32. | |
house_files = glob("House/*.Doc") | |
senate_files = glob("Senate/*.Doc") | |
# File where we'll dump all of the output. | |
oFile = open("legVoting.txt", "w+") |