civic hacking @ ruby hoedown

84
Civic Hacking Luigi Montanez [email protected]

Upload: luigi-montanez

Post on 21-Jan-2015

2.537 views

Category:

Technology


1 download

DESCRIPTION

Presented at Ruby Hoedown 2009.

TRANSCRIPT

Page 1: Civic Hacking @ Ruby Hoedown

Civic Hacking

Luigi [email protected]

Page 2: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

I am here to recruit you.

Page 3: Civic Hacking @ Ruby Hoedown
Page 4: Civic Hacking @ Ruby Hoedown
Page 5: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

“Transparency”

Page 6: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Everyone Wants Transparency

Page 7: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Questions for me? @LuigiMontanez

Page 8: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

“Civic Hacking”

Page 9: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Participatory Democracy

Page 10: Civic Hacking @ Ruby Hoedown
Page 11: Civic Hacking @ Ruby Hoedown
Page 12: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

But today...

Page 13: Civic Hacking @ Ruby Hoedown
Page 14: Civic Hacking @ Ruby Hoedown
Page 15: Civic Hacking @ Ruby Hoedown
Page 16: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Just plain lame!

Page 17: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Something not lame...

Page 18: Civic Hacking @ Ruby Hoedown
Page 19: Civic Hacking @ Ruby Hoedown

Text

Civic Hacking

Page 20: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Some Guiding Principles...

Page 21: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Electoral Politics

Page 22: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Electoral Politics

Governance

Page 23: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Closed Source

Page 24: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Closed Source

Open Source

Page 25: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Civic Side Projects

Page 26: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Open Source + Open Data =

Better Government

Page 27: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Government as a wholesaler, not retailer

Page 28: Civic Hacking @ Ruby Hoedown
Page 29: Civic Hacking @ Ruby Hoedown
Page 30: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

.fec? .wtf?

Page 31: Civic Hacking @ Ruby Hoedown
Page 32: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

High Quality Raw Data

✴ First: Raw data in XML, JSON, or CSV✴ Second: RESTful APIs in JSON/XML✴ Third: Nothing really...

Page 33: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Civic Hacking Defined

Page 34: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Federal Government

Page 35: Civic Hacking @ Ruby Hoedown

Credit: vgm8383 on Flickr

Page 36: Civic Hacking @ Ruby Hoedown
Page 37: Civic Hacking @ Ruby Hoedown
Page 38: Civic Hacking @ Ruby Hoedown
Page 39: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

APIs about Congress

✴ Sunlight Labs API - Bio and contact info✴ OpenSecrets.org - Contributions✴ GovTrack.us - Bills and Vote Records✴ MAPLight.org - Vote Influence

Page 40: Civic Hacking @ Ruby Hoedown
Page 41: Civic Hacking @ Ruby Hoedown
Page 42: Civic Hacking @ Ruby Hoedown
Page 43: Civic Hacking @ Ruby Hoedown
Page 44: Civic Hacking @ Ruby Hoedown
Page 45: Civic Hacking @ Ruby Hoedown
Page 46: Civic Hacking @ Ruby Hoedown
Page 47: Civic Hacking @ Ruby Hoedown
Page 48: Civic Hacking @ Ruby Hoedown
Page 49: Civic Hacking @ Ruby Hoedown
Page 50: Civic Hacking @ Ruby Hoedown
Page 51: Civic Hacking @ Ruby Hoedown
Page 52: Civic Hacking @ Ruby Hoedown
Page 53: Civic Hacking @ Ruby Hoedown
Page 54: Civic Hacking @ Ruby Hoedown
Page 55: Civic Hacking @ Ruby Hoedown
Page 56: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

U.S. Courts System✴ Supreme Court (1)✴ Courts of Appeals (12)✴ District Courts (94)✴ Courts for Patents, International Trade,

Bankruptcy

Page 57: Civic Hacking @ Ruby Hoedown
Page 58: Civic Hacking @ Ruby Hoedown
Page 59: Civic Hacking @ Ruby Hoedown
Page 60: Civic Hacking @ Ruby Hoedown
Page 61: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

States✴ Not much yet...✴ FollowTheMoney.org✴ 50 State Project - transform legislative data

for all 50 states into a common format

Page 62: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Cities✴ Washington, D.C. - api.dc.gov

Page 63: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

A CITY HAS AN API!!!

Page 64: Civic Hacking @ Ruby Hoedown
Page 65: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Cities✴ Washington, D.C. - Data Catalog, Open

311 API✴ New York City - Big Apps contest, Open

311 API✴ San Francisco - DataSF.org, App Store

Page 66: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Getting Involved✴ groups.google.com/group/sunlightlabs✴ #transparency on Freenode✴ github.com/sunlightlabs✴ @sunlightlabs on Twitter✴ SunlightLabs.com

Page 67: Civic Hacking @ Ruby Hoedown
Page 68: Civic Hacking @ Ruby Hoedown
Page 69: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Project Lifecycle1. Explore

2. Design

3. Implement/Test

4. Deploy

Page 70: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Deployment?

Page 71: Civic Hacking @ Ruby Hoedown
Page 72: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

GAE Daily Quotas✴ 1.3 million requests✴ 1 GB bandwidth outgoing✴ 1 GB bandwidth incoming✴ 6.5 CPU Hours✴ 10 million calls to the Datastore✴ 1 GB in the Datastore

Page 73: Civic Hacking @ Ruby Hoedown
Page 74: Civic Hacking @ Ruby Hoedown
Page 75: Civic Hacking @ Ruby Hoedown

$ sudo gem install google-appengine

$ sinatra-gen mycivicapp

Page 76: Civic Hacking @ Ruby Hoedown

# Inside config.ru

require 'appengine-rack'AppEngine::Rack.configure_app( :application => 'mycivicapp', :version => 1)require 'mycivicapp'run Sinatra::Application

Page 77: Civic Hacking @ Ruby Hoedown

$ appcfg.rb gem sources

$ appcfg.rb gem sources --add \ http://gems.datamapper.org

$ appcfg.rb gem install sinatra dm-appengine

Page 78: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

WEB-INF Directory✴ XML and YAML config✴ .jars for:

✴ AppEngine SDK (holds webserver, Datastore)

✴ JRuby, RubyGems, jruby-rack✴ Our installed gems

Page 79: Civic Hacking @ Ruby Hoedown

$ appcfg.rb --help

usage: /usr/bin/appcfg.rb [options] <action> <app-dir> [<output-file>]

Action must be one of: help: Print help for a specific action. request_logs: Write request logs in Apache common log format. rollback: Rollback an in-progress update. update: Create or update an app version. update_indexes: Update application indexes. version: Prints version information. update_cron: Update application cron jobs. run: run jruby in your application environment. gem: run rubygems for your application. bundle: package your application for deployment.The 'gem' and 'run' commands assume the app directory is the current directory.

Page 80: Civic Hacking @ Ruby Hoedown

$ dev_appserver.rb .

=> Booting DevAppServer=> Press Ctrl-C to shutdown server=> Installing JRuby=> Retrieving jruby-rack=> Installing appengine-sdk=> Generating configuration filesThe server is running at http://localhost:8080/^C

$ appcfg.rb run -S irb

$ appcfg.rb update .

Page 81: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

GAE Limitations✴ No ActiveRecord✴ No ImageMagick✴ No Sphinx✴ No Ruby gems with C extensions

Page 82: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Consider Civic Hacking✴ Enhance your skillset✴ Get noticed✴ Low risk, high reward✴ Another TDD framework? Really?✴ Local/state govts. an untapped market✴ Solve a hard problem

Page 83: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Thanks!

Page 84: Civic Hacking @ Ruby Hoedown

Question? @LuigiMontanez

Questions?