Skip to content

Instantly share code, notes, and snippets.

View JDougherty's full-sized avatar

Joseph W. Dougherty JDougherty

View GitHub Profile
class ArbitraryDateListView(ListView):
date_field = None
date_format = '%Y-%m-%d'
since_date = None
until_date = None
auto_until_date = False
def get_date_field(self):
if self.date_field is None:
raise ImproperlyConfigured("%s.date_field is required." % self.__class__.__name__)
from piazza_api import PiazzaAPI
import dateutil.parser
p = PiazzaAPI('hv3tfd1v38g7fc')
p.user_auth()
s_answers = 0
i_answers = 0
s_before_i = 0
import mechanize
from BeautifulSoup import BeautifulSoup
USERNAME = "foo@bar.com"
PASSWORD = "quxadux"
def main():
browser = mechanize.Browser()
print "Opening login page..."
@JDougherty
JDougherty / sis.py
Created May 13, 2012 05:58
A quick and dirty python script to scrape grades from RPI's student information system.
'''
Copyright (c) 2012, Joseph W. Dougherty
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@JDougherty
JDougherty / ccnaworkbookscrape.py
Created April 4, 2012 00:34
FreeCCNAWorkbook Scraper
# This is a quick and dirty script to grab the practice questions from
# the Free CCNA Workbook (http://www.freeccnaworkbook.com/) to place
# each question in its own file and be able to view one question at a time
from BeautifulSoup import BeautifulSoup
import urllib2
page = urllib2.urlopen("http://www.freeccnaworkbook.com/labs/free-ccna-workbook-ccna-practice-exam/")
soup = BeautifulSoup(page)
@JDougherty
JDougherty / RecordOnlineClean.js
Created April 24, 2011 22:03
A bookmarklet to remove the paywall popup at recordonline.com
javascript:{$('p').show();$('#colorbox').hide();$('#cboxOverlay').hide();}