You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3.1 KiB

Novinky Polls

Download and render opinion polls from the Czech news site

Supported output formats:

  • HTML
  • TeX
  • plain text


Arch Linux

# pacman -S pipenv
$ make setup

Other systems

Install these dependencies manually:

  • Python > 3.6
  • pipenv

Then run:

$ make setup


Each's poll is identified by a unique id. The poll data itself (title, answers, percents) are accessible using a public JSON API (for an example of an HTTP request to retrieve this data see novinky_polls/test/ The poll data however do not include information on when (date and time) the poll was present at's homepage. Therefore we need to get this information elsewhere -- either from or by checking current's homepage and saving current timestamp.

This software works in two phases:

1. Create a CSV file mapping poll timestamps to poll ids

Add poll ids and timestamps archived by to a CSV file:

./novinky-polls-add-archive-org -i my_polls.csv

Add current poll id with current timestamp to a CSV file:

./novinky-polls-add-current -i my_polls.csv

The CSV file my_polls.csv now contains a map of poll timestamps to poll ids:


Value None means that there was no poll at the time of the timestamp.

2. Download and render the polls

Once you have the CSV file, you can download the polls and render them in various formats.


./novinky-polls-render-html -c my_cache_dir -i my_polls.csv -o my_polls_export.html -l cs_CZ.utf8


./novinky-polls-render-print -c my_cache_dir -i my_polls.csv -o my_polls_export.tex -l cs_CZ.utf8

The TeX file is meant to be exported to PDF using lualatex.

Plain text

./novinky-polls-render-text -c my_cache_dir -i my_polls.csv -o my_polls_export.txt -l cs_CZ.utf8

Categorize polls and print the statistics

./novinky-polls-analyze -c my_cache_dir -i my_polls.csv


Call the executables with the argument -h or --help:

./novinky-polls-add-archive-org --help
./novinky-polls-add-current --help
./novinky-polls-render-html --help
./novinky-polls-render-print --help
./novinky-polls-render-text --help
./novinky-polls-analyze --help


Feel free to remix this project under the terms of the Apache License, Version 2.0.

You might find these reusable modules useful:

  • contains functions to download's homepage and parse the id of the current poll. It also contains functions to download a poll from's public JSON API.
  • contains functions to parse's poll JSON data and to read and write the map of poll timestamps to poll ids.
  • puts and together. Use it's functions to retrieve the data of all polls mentioned in the poll map.