Civic Hacking @ Ruby Hoedown

3,031 views
2,910 views

Published on

Presented at Ruby Hoedown 2009.

Published in: Technology, Sports
1 Comment
6 Likes
Statistics
Notes
No Downloads
Views
Total views
3,031
On SlideShare
0
From Embeds
0
Number of Embeds
279
Actions
Shares
0
Downloads
24
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

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?

×