tildered/tilde.red — pull request #6 by ijks (2014-12-20 21:21:46+00:00)
Title: Add voting scripts

As discussed in [this pull request](https://github.com/tildered/tilde.red-main-site/pull/1), we need a way for tilde.red users to vote on certain issues, e.g. a new background colour for the home page. So I'm writing two Ruby scripts, `vote` and `tally`. Vote allows users to vote on certain subjects, and with Tally, you can see the results for a vote. For more details, see the readme.

The system works as follows. A central JSON file detailing the available subjects would be stored somewhere, e.g. ~berkay's home folder or perhaps a superuser-only directory, like a directory under `/etc/`. When a user votes for something, a `.vote.json` file is created in their home directory. The tally script then looks at the .vote file for every user, tallying the votes for each subject, or for a specific subject. The results can optionally be outputted as a JSON file, allowing for someone to run a cronjob (i.e. timed command) that outputs to e.g. `~/public_html/votes.json`, creating a public API of sorts for the votes system.

Right now, the vote script is in a working state. However, I'm new to Ruby, so please tell me if you find any bugs. ;) I will be finishing the tally script soon™.