Name: leftronic-java
Owner: Kik Interactive
Description: A Java API to send data to Leftronic dashboards
Created: 2015-09-25 20:21:08.0
Updated: 2015-09-25 20:21:09.0
Pushed: 2015-09-28 17:28:48.0
Size: 121
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a simple Java API that wraps the Leftronic REST APIs documented here.
The easiest way to get started is to just add this dependency in to your Maven build:
endency>
<groupId>biz.neustar</groupId>
<artifactId>leftronic</artifactId>
<version>1.0-beta-1</version>
pendency>
If you don't use Maven, you can still find the jars in the central Maven repository. You'll also need the following dependencies:
The API is pretty straight forward if you've read the Leftronic API docs:
ronicClient client = new LeftronicClient("access_key", 4);
nt.sendNumber("Number-Stream", 300);
nt.sendGeoPoint("Geo-Stream", 45.8, -115.6);
om r = new Random();
nt.sendLeaderboard("Leader-Stream",
new LeaderboardEntry("Ian", r.nextInt(100)),
new LeaderboardEntry("Patrick", r.nextInt(100)),
new LeaderboardEntry("Barney", r.nextInt(100)));
nt.sendList("Test-Stream", "Fe", "Fi", "Fo", "Fum");
nt.sendText("Test-Stream", "Custom Title", "This is a new message");
You can also wire up the LeftronicClient using dependency injection frameworks such as Guice. The constructor parameters are bound to the following @Named parameters:
Note: The client always uses SSL to make it's HTTP requests and until we hear a good reason we won't be offering an option to change this.
This project is licensed under the Apache 2.0 license.