Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Civic Hacking
Luigi Montanez
luigi@sunlightfoundation.com
Question? @LuigiMontanez
I am here to
recruit you.
Question? @LuigiMontanez
“Transparency”
Question? @LuigiMontanez
Everyone Wants
Transparency
Question? @LuigiMontanez
Questions for me?
@LuigiMontanez
Question? @LuigiMontanez
“Civic Hacking”
Question? @LuigiMontanez
Participatory
Democracy
Question? @LuigiMontanez
But today...
Question? @LuigiMontanez
Just plain lame!
Question? @LuigiMontanez
Something not
lame...
Text
Civic Hacking
Question? @LuigiMontanez
Some Guiding
Principles...
Question? @LuigiMontanez
Electoral Politics
Question? @LuigiMontanez
Electoral Politics
Governance
Question? @LuigiMontanez
Closed Source
Question? @LuigiMontanez
Closed Source
Open Source
Question? @LuigiMontanez
Civic Side Projects
Question? @LuigiMontanez
Open Source + Open Data
=
Better Government
Question? @LuigiMontanez
Government as a
wholesaler, not retailer
Question? @LuigiMontanez
.fec? .wtf?
Question? @LuigiMontanez
High Quality Raw Data
✴ First: Raw data in XML, JSON, or CSV
✴ Second: RESTful APIs in JSON/XML
✴...
Question? @LuigiMontanez
Civic Hacking
Defined
Question? @LuigiMontanez
Federal
Government
Credit: vgm8383 on Flickr
Question? @LuigiMontanez
APIs about Congress
✴ Sunlight Labs API - Bio and contact info
✴ OpenSecrets.org - Contributions
...
Question? @LuigiMontanez
U.S. Courts System
✴ Supreme Court (1)
✴ Courts of Appeals (12)
✴ District Courts (94)
✴ Courts f...
Question? @LuigiMontanez
States
✴ Not much yet...
✴ FollowTheMoney.org
✴ 50 State Project - transform legislative data
for...
Question? @LuigiMontanez
Cities
✴ Washington, D.C. - api.dc.gov
Question? @LuigiMontanez
A CITY HAS
AN API!!!
Question? @LuigiMontanez
Cities
✴ Washington, D.C. - Data Catalog, Open
311 API
✴ New York City - Big Apps contest, Open
3...
Question? @LuigiMontanez
Getting Involved
✴ groups.google.com/group/sunlightlabs
✴ #transparency on Freenode
✴ github.com/...
Question? @LuigiMontanez
Project Lifecycle
1. Explore
2. Design
3. Implement/Test
4. Deploy
Question? @LuigiMontanez
Deployment?
Question? @LuigiMontanez
GAE Daily Quotas
✴ 1.3 million requests
✴ 1 GB bandwidth outgoing
✴ 1 GB bandwidth incoming
✴ 6.5...
$ sudo gem install google-appengine
$ sinatra-gen mycivicapp
# Inside config.ru
require 'appengine-rack'
AppEngine::Rack.configure_app(
:application => 'mycivicapp',
:version => 1)
re...
$ appcfg.rb gem sources
$ appcfg.rb gem sources --add 
http://gems.datamapper.org
$ appcfg.rb gem install sinatra dm-appen...
Question? @LuigiMontanez
WEB-INF Directory
✴ XML and YAML config
✴ .jars for:
✴ AppEngine SDK (holds webserver,
Datastore)
...
$ appcfg.rb --help
usage: /usr/bin/appcfg.rb [options] <action> <app-dir> [<output-file>]
Action must be one of:
help: Pri...
$ dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
=> Installing JRuby
=> Retrieving jruby-ra...
Question? @LuigiMontanez
GAE Limitations
✴ No ActiveRecord
✴ No ImageMagick
✴ No Sphinx
✴ No Ruby gems with C extensions
Question? @LuigiMontanez
Consider Civic Hacking
✴ Enhance your skillset
✴ Get noticed
✴ Low risk, high reward
✴ Another TD...
Question? @LuigiMontanez
Thanks!
Question? @LuigiMontanez
Questions?
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Civic Hacking @ Ruby Hoedown
Upcoming SlideShare
Loading in …5
×

Civic Hacking @ Ruby Hoedown

3,226 views

Published on

Presented at Ruby Hoedown 2009.

Published in: Technology, Sports

Civic Hacking @ Ruby Hoedown

  1. 1. Civic Hacking Luigi Montanez luigi@sunlightfoundation.com
  2. 2. Question? @LuigiMontanez I am here to recruit you.
  3. 3. Question? @LuigiMontanez “Transparency”
  4. 4. Question? @LuigiMontanez Everyone Wants Transparency
  5. 5. Question? @LuigiMontanez Questions for me? @LuigiMontanez
  6. 6. Question? @LuigiMontanez “Civic Hacking”
  7. 7. Question? @LuigiMontanez Participatory Democracy
  8. 8. Question? @LuigiMontanez But today...
  9. 9. Question? @LuigiMontanez Just plain lame!
  10. 10. Question? @LuigiMontanez Something not lame...
  11. 11. Text Civic Hacking
  12. 12. Question? @LuigiMontanez Some Guiding Principles...
  13. 13. Question? @LuigiMontanez Electoral Politics
  14. 14. Question? @LuigiMontanez Electoral Politics Governance
  15. 15. Question? @LuigiMontanez Closed Source
  16. 16. Question? @LuigiMontanez Closed Source Open Source
  17. 17. Question? @LuigiMontanez Civic Side Projects
  18. 18. Question? @LuigiMontanez Open Source + Open Data = Better Government
  19. 19. Question? @LuigiMontanez Government as a wholesaler, not retailer
  20. 20. Question? @LuigiMontanez .fec? .wtf?
  21. 21. Question? @LuigiMontanez High Quality Raw Data ✴ First: Raw data in XML, JSON, or CSV ✴ Second: RESTful APIs in JSON/XML ✴ Third: Nothing really...
  22. 22. Question? @LuigiMontanez Civic Hacking Defined
  23. 23. Question? @LuigiMontanez Federal Government
  24. 24. Credit: vgm8383 on Flickr
  25. 25. 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
  26. 26. Question? @LuigiMontanez U.S. Courts System ✴ Supreme Court (1) ✴ Courts of Appeals (12) ✴ District Courts (94) ✴ Courts for Patents, International Trade, Bankruptcy
  27. 27. Question? @LuigiMontanez States ✴ Not much yet... ✴ FollowTheMoney.org ✴ 50 State Project - transform legislative data for all 50 states into a common format
  28. 28. Question? @LuigiMontanez Cities ✴ Washington, D.C. - api.dc.gov
  29. 29. Question? @LuigiMontanez A CITY HAS AN API!!!
  30. 30. 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
  31. 31. Question? @LuigiMontanez Getting Involved ✴ groups.google.com/group/sunlightlabs ✴ #transparency on Freenode ✴ github.com/sunlightlabs ✴ @sunlightlabs on Twitter ✴ SunlightLabs.com
  32. 32. Question? @LuigiMontanez Project Lifecycle 1. Explore 2. Design 3. Implement/Test 4. Deploy
  33. 33. Question? @LuigiMontanez Deployment?
  34. 34. 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
  35. 35. $ sudo gem install google-appengine $ sinatra-gen mycivicapp
  36. 36. # Inside config.ru require 'appengine-rack' AppEngine::Rack.configure_app( :application => 'mycivicapp', :version => 1) require 'mycivicapp' run Sinatra::Application
  37. 37. $ appcfg.rb gem sources $ appcfg.rb gem sources --add http://gems.datamapper.org $ appcfg.rb gem install sinatra dm-appengine
  38. 38. Question? @LuigiMontanez WEB-INF Directory ✴ XML and YAML config ✴ .jars for: ✴ AppEngine SDK (holds webserver, Datastore) ✴ JRuby, RubyGems, jruby-rack ✴ Our installed gems
  39. 39. $ 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.
  40. 40. $ dev_appserver.rb . => Booting DevAppServer => Press Ctrl-C to shutdown server => Installing JRuby => Retrieving jruby-rack => Installing appengine-sdk => Generating configuration files The server is running at http://localhost:8080/ ^C $ appcfg.rb run -S irb $ appcfg.rb update .
  41. 41. Question? @LuigiMontanez GAE Limitations ✴ No ActiveRecord ✴ No ImageMagick ✴ No Sphinx ✴ No Ruby gems with C extensions
  42. 42. 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
  43. 43. Question? @LuigiMontanez Thanks!
  44. 44. Question? @LuigiMontanez Questions?

×