The MoaiCloud Leaderboard service is a general purpose leaderboard. It is a REST based service that currently supports a few basic operations. POSTs can be made to a board to record scores and GETs can be used to either retrieve a desired set of scores or scores close to a player's best.
Adding scores is done by POSTing to http://services.moaicloud.com/moai/leaderboard/<board>. If the board doesn't exist it will be created. The body of the request should contain a userid, a username and the score to be posted. The newly created score record will be returned along with the position it holds in the board. A few additional options can be set passing unique equal to true in the body ensures that each userid can only have 1 entry on each board. By passing a sort=asc the score returned will have it's position determined by sorting scores from lowest to highest.
Retrieving scores is done by making a GET request to http://services.moaicloud.com/moai/leaderboard/<board>. Scores are ranked with the highest first unless a sort=asc is provided. sort=desc can be provided to explicitly ask for scores to be ranked high to low. There are two ways to retrieve scores. By passing a 1-based 'page' number and a pagesize a board can be paged through from start to finish. If a userid is included the user's score will also be returned. By passing neighborhood=true the scores closest to the provided userid can be retrieved. By passing before and after counts a number of scores before and after the user's will be returned. If the user does not have an entry on the board the top before+after+1 scores will be returned.
scores - Stores score information for all boards
|username||string||A user provided name|
|date||integer||GMT seconds since the epoch|
|userid||string||Unique user identifier|
Recording a Score