Upload
luigi-montanez
View
2.540
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Presented at Ruby Hoedown 2009.
Citation preview
Civic Hacking
Luigi [email protected]
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✴ Third: Nothing really...
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✴ GovTrack.us - Bills and Vote Records✴ MAPLight.org - Vote Influence
Question? @LuigiMontanez
U.S. Courts System✴ Supreme Court (1)✴ Courts of Appeals (12)✴ District Courts (94)✴ Courts for Patents, International Trade,
Bankruptcy
Question? @LuigiMontanez
States✴ Not much yet...✴ FollowTheMoney.org✴ 50 State Project - transform legislative data
for all 50 states into a common format
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
311 API✴ San Francisco - DataSF.org, App Store
Question? @LuigiMontanez
Getting Involved✴ groups.google.com/group/sunlightlabs✴ #transparency on Freenode✴ github.com/sunlightlabs✴ @sunlightlabs on Twitter✴ SunlightLabs.com
Question? @LuigiMontanez
Project Lifecycle1. 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 CPU Hours✴ 10 million calls to the Datastore✴ 1 GB in the Datastore
$ sudo gem install google-appengine
$ sinatra-gen mycivicapp
# Inside config.ru
require 'appengine-rack'AppEngine::Rack.configure_app( :application => 'mycivicapp', :version => 1)require 'mycivicapp'run Sinatra::Application
$ appcfg.rb gem sources
$ appcfg.rb gem sources --add \ http://gems.datamapper.org
$ appcfg.rb gem install sinatra dm-appengine
Question? @LuigiMontanez
WEB-INF Directory✴ XML and YAML config✴ .jars for:
✴ AppEngine SDK (holds webserver, Datastore)
✴ JRuby, RubyGems, jruby-rack✴ Our installed gems
$ 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.
$ 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 .
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 TDD framework? Really?✴ Local/state govts. an untapped market✴ Solve a hard problem
Question? @LuigiMontanez
Thanks!
Question? @LuigiMontanez
Questions?