I was inspired by @Qwerty’s api so I started down the road of playing with Triton’s Data. These are the fruits of the last 24 hours.
First thing I did was to write a PHP wrapper for the server’s data API…
phpTriton: a PHP wrapper
Get the client on GitHub: GitHub - wrenoud/phpTriton: A PHP client for the unpublished API for Neptune's Pride II: Triton
It’s really easy to work with:
require "phpTriton/client.php";
$client = new TritonClient($alias, $password);
if($client->authenticate()){
$game = $client->GetGame($game_id);
$universe = $game->GetFullUniverse();
}
Another API endpoint
With a client written, I made my own endpoint for getting public game data. The format is subtly different, I wanted it to be compatible with Ember RESTAdapter.
Endpoint: http://triton.theducky.com/api/games/<game number>
i.e. http://triton.theducky.com/api/games/4985364317995008
{
games: {
id: "4985364317995008",
name: "Phi Achernar",
tick: 92,
...
stars: [...],
players: [...]
}
}
Making Charts
With my own api in place I then got to making some Google Charts.
The results of my playing can be seen at http://triton.theducky.com/. A game number can be dynamically enter in the interface, or include it in the url to auto load.
i.e. http://triton.theducky.com/#4985364317995008
I was lacking creativity though. If anyone can think of plots they’d like to see I’ll add them to the interface.