CSS Python HTML JavaScript Makefile Shell Mako
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
alembic Add favorite bill table May 16, 2015
pokr Merge branch 'master' of github.com:teampopong/pokr.kr Apr 8, 2017
utils Auto change year in footer Nov 20, 2015
.gitignore Enable npm Apr 1, 2016
.gitmodules Use popong-nlp package instead of submodule Jun 14, 2014
LICENSE Update README and LICENSE Oct 3, 2013
README.md node-uglify is erroneous in Ubuntu Apr 11, 2016
babel.cfg Make top-level pokr module Mar 26, 2014
requirements.txt Bump up nltk to 3.0.1 Jan 11, 2017
run.py Fixing some build scripts to use python in path not global python Mar 21, 2015
shell.py Fixing some build scripts to use python in path not global python Mar 21, 2015


Pokr - Politics in Korea

Pull requests are always welcome.


  1. Install dependencies

    • Ubuntu

        $ sudo apt-get install nodejs postgresql-9.3 npm python-psycopg2 node-less
        $ sudo npm install -g uglify-js
        $ sudo pip install -r requirements.txt
        $ sudo pip install git+https://github.com/teampopong/popong-nlp.git
        $ sudo make install
    • Mac OS X

        $ brew install node postgresql
        $ npm install less uglify-js -g
        $ pip install -r requirements.txt
        $ pip install psycopg2
        $ make install
  2. Create & modify configuration files

     $ make init
     $ createuser postgres
    • Set password for user "postgres" in PostgreSQL

        ALTER USER "postgres" WITH PASSWORD 'new_password';
    • Modify alembic.ini

      • ID_HERE: postgres id (ex: postgres)
      • PASSWD_HERE: postgres pw
      • HOST_HERE: postgres host (ex: localhost)
  3. Create & init DB (You should first obtain a pokrdb.dump from here)

     $ sudo -u postgres psql -h localhost -U postgres -c 'CREATE DATABASE pokrdb;'
     $ sudo -u postgres psql -d pokrdb -f pokrdb.dump
     $ ./shell.py db init
     $ alembic stamp head

Run Server

$ ./run.py [-d] [-l LOCALE] [--port PORT]

Update Data

  1. Bills

     $ ./shell.py bill update "some/where/*.json" # from files
     $ ./shell.py bill update --source redis  # from Redis queue
     $ ./shell.py bill update --source db  # existing bills of the current session
  2. Bill Keywords

     $ ./shell.py bill_keyword update "some/where/*.txt"
  3. Candidacies

     $ ./shell.py candidacy update "some/where/*.json"
  4. People

     $ ./shell.py person update "some/where/*.json"

    when the json is in this form.


Apache v2.0