]> projects.mako.cc - selectricity-live/blobdiff - README
Add some quick info about XMLRPC API
[selectricity-live] / README
diff --git a/README b/README
index f8a8928fda987277debb2a5b2eca825684d3a5d4..88fcd974eec3baf3f11a8dc97c5e31d6bf813648 100644 (file)
--- a/README
+++ b/README
@@ -81,6 +81,26 @@ gem installed, you can use the ri command, or the above mentioned gem_server.
 
 If you guys want more helpful stuff here, let me know.
 
+======================================
+=== XML-RPC INFO                    ==
+======================================
+
+The XML-RPC API is still under development, but is somewhat functional already:
+
+To instantiate a client in Ruby, try something like:
+client=ActionWebService::Client::XmlRpc.new(SelectricityAPI,"http://localhost:3000/selectricity_service/vote")
+
+
+Getting the results of a quickvote is quite simple:
+?> client.get_quickvote_results("test")
+=> #<VoteResultStruct:0x336f92c @approval_winners=[1, 2], @borda_winners=[1], @plurality_winners=[1], @ssd_winners=[1], @errors=[], @condorcet_winners=[1]>
+
+Casting a quickvote:
+client.cast_quickvote("test",1,[[1,2]])
+
+To figure out what you're voting for:
+>> client.get_quickvote_candidate_map("test")=> #<CandidateMap:0x335bbc0 @errors=[], @candidate_names=["test", "test2"], @candidate_ids=[1, 2]>
+
 
 
 

Benjamin Mako Hill || Want to submit a patch?