364f61647ef942b00dfc43fffd90056a3c51f28c
[selectricity-live] / README
1 ===============================================
2 === Getting Selectricity ======================
3 ===============================================
4
5 Selectricity is free software and is distributed under the GNU Affero
6 General Public License version 3. You are free to use, modify, and
7 distribute, or rework Selectricity under the terms of that license. Of
8 course, we'd sure like it if you would send fixes back to us and tell us
9 about cool stuff you do with our software!
10
11 The best way to get Selectricity is just to download it from our source
12 source repository. You'll need the Git version control system or
13 source control manager to check it. You can get it here:
14
15   http://git-scm.com/
16
17 Once you have it, getting the source code is pretty easy. You just need
18 to check out a branch with a command like this:
19
20   git clone http://projects.mako.cc/source/selectricity/.git
21
22 This will give you the latest *development* version of our code. If you
23 want the latest production version (i.e., what we're running on the
24 site), you can grab that here:
25
26   git clone http://projects.mako.cc/source/selectricity-live/.git
27
28 ===============================================
29 === Dependencies ==============================
30 ===============================================
31
32 To use Selectricity, you'll need to install the following gems in
33 addition to Ruby on Rails, MySQL, and its dependencies:
34
35  * rmagick
36  * gruff (http://nubyonrails.com/pages/gruff)
37  * sparklines (http://nubyonrails.com/pages/sparklines)
38
39 To use Selectricity in development mode, you'll need to install the
40 following gems:
41
42  * ruby-debug
43
44 Also, you will need install the other applications installed first:
45
46  * imagemagick (http://www.imagemagick.org/)
47
48 On Ubuntu, you can install install the dependencies with: 
49   apt-get install imagemagick libmagick9-dev ruby1.8-dev libwmf-bin
50
51 Our server configuration uses Mongrel (installed from gems) behind an
52 Apache2 load balancing proxy using mod_proxy.
53
54 You'll also need to have a MTA installed. We use Postfix and have not
55 tried it with any other system. Presumably though, anything that
56 provides '/usr/bin/sendmail' should work.
57
58 ===============================================
59 === Contributors to Selectricity Include ======
60 ===============================================
61
62  * Benjamin Mako Hill <mako@atdot.cc>
63  * John Dong          <jdong@ubuntu.com>
64  * Justin Sharps      <jlsharps@mit.edu>
65
66 =====================================
67 === XML-RPC INFO                    ==
68 ======================================
69
70 The XML-RPC API is still under development, but is somewhat functional already:
71
72 To instantiate a client in Ruby, try something like:
73 client=ActionWebService::Client::XmlRpc.new(SelectricityAPI,"http://localhost:3000/selectricity_service/vote")
74
75
76 Getting the results of a quickvote is quite simple:
77 ?> client.get_quickvote_results("test")
78 => #<VoteResultStruct:0x336f92c @approval_winners=[1, 2], @borda_winners=[1], @plurality_winners=[1], @ssd_winners=[1], @errors=[], @condorcet_winners=[1]>
79
80 Casting a quickvote:
81 client.cast_quickvote("test",1,[[1,2]])
82
83 To figure out what you're voting for:
84 >> client.get_quickvote_candidate_map("test")=> #<CandidateMap:0x335bbc0 @errors=[], @candidate_names=["test", "test2"], @candidate_ids=[1, 2]>
85
86
87
88
89

Benjamin Mako Hill || Want to submit a patch?