merged in from code from the other master
[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 By default, this will create a working copy with the latest
23 *development* version of our code. If you want the latest production
24 version (i.e., what we're running on the site), you need to switch to
25 the live version of the software which is kept in a branch called
26 "live." Once you cloned the repository above, you can switch into the
27 directory (i.e., run "cd selectricity") and then run the following
28 command:
29
30   git checkout -b live origin/live
31
32
33 ===============================================
34 === Dependencies ==============================
35 ===============================================
36
37 To use Selectricity, you'll need to install the following gems in
38 addition to Ruby on Rails, MySQL, and its dependencies:
39
40  * rmagick
41  * gruff (http://nubyonrails.com/pages/gruff)
42  * sparklines (http://nubyonrails.com/pages/sparklines)
43
44 To use Selectricity in development mode, you'll need to install the
45 following gems:
46
47  * ruby-debug
48
49 Also, you will need install the other applications installed first:
50
51  * imagemagick (http://www.imagemagick.org/)
52
53 On Ubuntu, you can install install the dependencies with: 
54   apt-get install imagemagick libmagick9-dev ruby1.8-dev libwmf-bin
55
56 Our server configuration uses Mongrel (installed from gems) behind an
57 Apache2 load balancing proxy using mod_proxy.
58
59 You'll also need to have a MTA installed. We use Postfix and have not
60 tried it with any other system. Presumably though, anything that
61 provides '/usr/bin/sendmail' should work.
62
63 ===============================================
64 === Contributors to Selectricity Include ======
65 ===============================================
66
67  * Benjamin Mako Hill <mako@atdot.cc>
68  * John Dong          <jdong@ubuntu.com>
69  * Justin Sharps      <jlsharps@mit.edu>
70
71 =====================================
72 === XML-RPC INFO                    ==
73 ======================================
74
75 The XML-RPC API is still under development, but is somewhat functional already:
76
77 To instantiate a client in Ruby, try something like:
78 client=ActionWebService::Client::XmlRpc.new(SelectricityAPI,"http://localhost:3000/selectricity_service/vote")
79
80
81 Getting the results of a quickvote is quite simple:
82 ?> client.get_quickvote_results("test")
83 => #<VoteResultStruct:0x336f92c @approval_winners=[1, 2], @borda_winners=[1], @plurality_winners=[1], @ssd_winners=[1], @errors=[], @condorcet_winners=[1]>
84
85 Casting a quickvote:
86 client.cast_quickvote("test",1,[[1,2]])
87
88 To figure out what you're voting for:
89 >> client.get_quickvote_candidate_map("test")=> #<CandidateMap:0x335bbc0 @errors=[], @candidate_names=["test", "test2"], @candidate_ids=[1, 2]>
90
91
92
93
94

Benjamin Mako Hill || Want to submit a patch?