2 <link rel="stylesheet" type="text/css" href="stylesheets/main.css" />
4 <h3>Selectricity XML-RPC<br />
5 <font size="-1">Voting Machinery <em>By the Machinery, for the Machinery</em></font></h3>
9 <p>Selectricity has a fully functional XML-RPC interface so that you can
10 interface your own application with Selectricity. This API is documented in
11 the doc/ subdirectry, under the class <b>SelectricityService</b>. </p>
15 <p>The XML-RPC service runs at <em>/selectricity_service/vote</em> of the server.
16 All of the available methods are documented both below and in the RubyDoc
17 generated documentation. <br> </p>
20 <h4>Important Note</h4> <p>Please note that the Rails framework automatically
21 changes the case of a method name by capitalizing words separated by an
22 underscore. For example, if you see <em>this_method_name</em>, the actual method
23 name you need to call is actually <em>ThisMethodName</em>. </p>
27 <h4>Example PHP Script</h4>
28 <p>Here is a short PHP script that calls the Selectricity Service to output all
29 active QuickVotes to a table. It assumes that you have the samples/utils folder
30 from <a href=http://xmlrpc-epi.sourceforge.net/main.php?t=php_about>The PHP
31 XML-RPC Library</a> installed to utils/ in the include path.
37 include("utils/utils.php");
39 $host="192.168.195.1";
40 $uri="/selectricity_service/vote";
41 $result = xu_rpc_http_concise(
43 'method' => "ListQuickvotes",
49 echo "<table border=1>\n";echo "<tr><th>Name</th>
50 <th>Description</th><th>ID</th>
51 <th>Candidates</th></tr>\n";
52 foreach($result as $i)
55 echo "<tr><td>";
57 echo "</td><td>";
58 echo $i['description'];
59 echo "</td><td>";
61 echo "</td><td>";
62 foreach($i['candidate_names'] as $cand)
66 echo "</td></tr>";
77 <p><font size="-1">Copyleft 2006 ::
78 <a href="http://www.media.mit.edu">MIT Media Lab</a> and
79 <a href="http://mako.cc">Benjamin Mako Hill</a></font></p>