Created
January 21, 2009 20:47
-
-
Save brosner/50177 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 csv | |
| import urllib2 | |
| import urlparse | |
| def get_project_issues(project): | |
| r = urllib2.urlopen("http://code.google.com/p/%s/issues/csv" % project) | |
| first = True | |
| for row in csv.reader(r): | |
| if first: | |
| first = False | |
| continue | |
| if not row: | |
| continue | |
| yield row | |
| def get_projects(): | |
| projects = [] | |
| raw_data = urllib2.urlopen("http://svn.pinaxproject.com/pinax/trunk/apps/external_apps/svn.externals").read() | |
| for line in raw_data.split("\n"): | |
| if line: | |
| bits = line.split() | |
| if not bits[0].startswith("#"): | |
| yield urlparse.urlparse(bits[-1])[1].split(".")[0] | |
| def main(): | |
| total = 0 | |
| for project in get_projects(): | |
| total += len(list(get_project_issues(project))) | |
| print total | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment