mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 07:43:13 +01:00
Stadtratmonitor – Frontend
https://stadtratmonitor.leipzig.codefor.de
app | ||
bin | ||
config | ||
db | ||
lib | ||
log | ||
public | ||
test | ||
vendor/assets | ||
.dockerignore | ||
.gitignore | ||
.ruby-version | ||
config.ru | ||
docker-compose.yml | ||
Dockerfile | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
Rakefile | ||
README.md |
Stadtratmonitor
Setup
- Install Ruby, Bundler, Elasticsearch
- Start Elasticsearch:
elasticsearch
- Setup Rails app:
bundle && bundle exec rake db:setup
- Start Rails server:
bundle exec rails s
- 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:
- Start Rails console
bundle exec rails console
Import.create(url: "https://api.morph.io/[scraper]/data.json?key=[api_key]&query=[sql]")
exit
Now import everything via bundle exec rake import_papers
.