congress

Second Life Capitol Hill Congressional Info Centers

| | |

Sunlight Labs has developed APIs to access loads of information about members of congress, so it seemed a natural for me to mash them up with Second Life Capitol Hill and create a resource to find out all about your representative or senator. After Ryan Bretag's nice compliment that SL Capitol Hill was one of the "3 Best Educational Places in Second Life" along with his challenge "(well, it has the potential)" I was inspired to make it more so.

First, I created a House of Representatives info center. Sunlight's APIs return lots of info for each representative, given the rep's state and district. Most people don't know their Congressional district, so my first step was to map from ZIP Code to district. There are commercial databases that do this, but they run in the hundreds of dollars, so I found one that was free, and wrote a little MySQL to map one to the other. (First SQL programming I've done in about 22 years!)

Unfortunately, the free database was incomplete - missing the mapping for all ZIPs starting with 0 or 1 (sorry Rik.) So for these ZIPs, I look up ZIP to City/State, then the visitor needs to pick a representative from the list. Though the APIs support ZIP+4, I haven't implemented that yet, and some ZIPs have more than one representative, so in that case, I pop a dialog to choose which rep. [4/6/2007 Update - there's a new Sunlight Labs API to get State/District from ZIP. It's complete and much faster!]

Once a representative is chosen, the "Congressional Oracle" (a rotating transparent orb with swirly texture) turns red for Republican, blue for Democrat or green for independent. The Oracle's floating text shows the rep's name, party, state and district. Then I pop a picture of the rep, loaded from sunlightlabs.com, onto the sign. (That one's a little tricky, especially when the pictures on the Sunlight Labs web site are variable sizes.)

The sign's buttons are then populated with URL dispensers pointing to some great sources of data about that specific representative. The data sources include:

Once done with the House version, I moved on to the Senate version. For this one, you chat a two-letter state abbreviation, and you get a dialog to choose which Senator. Other than that, it's the same as the House version.

Dr. Carl Anderson of Sunlight Labs was very responsive with tweaks to the APIs that were necessary to get this done, and great feedback from avatars Rik Riel and LailaLei Mathilde (and non-avatar Greg Elin) helped me debug and finetune it. Thanks to Leon Atkinson for setting me on the trail of the APIs to begin with and helping me shake the rust off my SQL.

(Second Life Capitol Hill is a nonpartisan region created by Clear Ink for the benefit of the Second Life community as a venue for political discussion and education.)

Syndicate content