Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:sunlightlabs/openstates

  • Loading branch information...
commit 1e576fb0249fcaac2867dbb2e42df3f1326575e7 2 parents 3716967 + 3c5ef31
@twneale twneale authored
View
7 openstates/ma/legislators.py
@@ -61,13 +61,6 @@ def scrape_member(self, chamber, term, member_url):
root = lxml.html.fromstring(page)
root.make_links_absolute(member_url)
- oops_div = root.xpath("//h2")[0].text_content().strip()
- if oops_div == "Oops!":
- self.warning("Skipping %s" % member_url)
- # Please see bug #315. When you remove this code, remove that
- # bug.
- return
-
photo_url = root.xpath('//div[starts-with(@class,"bioPicContainer")]/img/@src')[0]
photo_url = root.xpath('//div[starts-with(@class,"bioPicContainer")]/img/@src')[0]
full_name = root.xpath('//div[starts-with(@class,"bioPicContainer")]/img/@alt')[0]
View
29 scripts/potential_duped_legislators.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+from sunlight import openstates
+import sys
+import codecs
+sys.stdout=codecs.getwriter('utf-8')(sys.stdout)
+
+state = sys.argv[1]
+
+kwargs = {
+ "state": state
+}
+
+legis = openstates.legislators(**kwargs)
+for leg in legis:
+ search = openstates.legislators(
+ first_name=leg['first_name'],
+ last_name=leg['last_name'],
+ active="false",
+ state=state
+ )
+ for s in search:
+ if s['leg_id'] != leg['leg_id']:
+ print s['full_name']
+ print leg['full_name']
+ print " %s / %s" % (
+ s['leg_id'], leg['leg_id']
+ )
+ print ""
View
14 scripts/updated_report.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+from billy import db
+
+watch = [ 'ma', 'nj', 'il', 'ny' ]
+
+for row in db.reports.find():
+ if not row['_id'] in watch:
+ continue
+
+ for guy in [ 'bills' ]:
+ for thing in [ 'updated_this_month', 'updated_today' ]:
+ print "(%s) %s %s: %s" % ( row['_id'], guy, thing, row[guy][thing] )
+ print ""
Please sign in to comment.
Something went wrong with that request. Please try again.