Stadtratmonitor – Frontend https://stadtratmonitor.leipzig.codefor.de
Find a file
2015-11-23 22:10:42 +01:00
app use german analyzer 2015-07-18 12:44:40 +02:00
bin Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
config Add config file for morph for importing papers 2015-11-09 21:35:32 +01:00
db Add importer model, validations to paper model 2015-05-17 18:30:03 +02:00
lib Fix importer rake task 2015-11-09 21:41:31 +01:00
log Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
public Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
test Add importer model, validations to paper model 2015-05-17 18:30:03 +02:00
vendor/assets Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
.gitignore Add config file for morph for importing papers 2015-11-09 21:35:32 +01:00
.ruby-version Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
config.ru Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
Gemfile add quiet_assets and factory_girls gems 2015-11-23 22:10:42 +01:00
Gemfile.lock add quiet_assets and factory_girls gems 2015-11-23 22:10:42 +01:00
LICENSE Initial commit 2014-11-19 17:03:06 +01:00
Rakefile Start with a Rails app with authentication via Persona, Foundation CSS 2014-11-19 18:48:28 +01:00
README.md Rename import task to import_papers 2015-07-27 22:57:32 +02:00

Stadtratmonitor

Setup

  1. Install Ruby, Bundler, Elasticsearch
  2. Start Elasticsearch: elasticsearch
  3. Setup Rails app: bundle && bundle exec rake db:setup
  4. Start Rails server: bundle exec rails s
  5. Visit http://localhost:3000

TODOs: https://github.com/ahx/stadtratmonitor/issues

Adding a data source (web scraper)

Example scraper: https://morph.io/ahx/city_council_leipzig_recent_papers

Scrapers are stored inside the database (see "Importer" model). To Add a new scraper, you have to create a new Importer record and set it's url field to Morph.io's API URL field.

Adding a scraper manually:

  1. Start Rails console bundle exec rails console
  2. Import.create(url: "https://api.morph.io/[scraper]/data.json?key=[api_key]&query=[sql]")
  3. exit

Now import everything via bundle exec rake import_papers.