GithubHelp home page GithubHelp logo

leftronic-java's Introduction

Leftronic Java API

This is a simple Java API that wraps the Leftronic REST APIs documented here.

Downloading

The easiest way to get started is to just add this dependency in to your Maven build:

<dependency>
    <groupId>biz.neustar</groupId>
    <artifactId>leftronic</artifactId>
    <version>1.0-beta-1</version>
</dependency>

If you don't use Maven, you can still find the jars in the central Maven repository. You'll also need the following dependencies:

Using

The API is pretty straight forward if you've read the Leftronic API docs:

LeftronicClient client = new LeftronicClient("access_key", 4);

client.sendNumber("Number-Stream", 300);

client.sendGeoPoint("Geo-Stream", 45.8, -115.6);

Random r = new Random();
client.sendLeaderboard("Leader-Stream",
        new LeaderboardEntry("Ian", r.nextInt(100)),
        new LeaderboardEntry("Patrick", r.nextInt(100)),
        new LeaderboardEntry("Barney", r.nextInt(100)));

client.sendList("Test-Stream", "Fe", "Fi", "Fo", "Fum");

client.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:

  • @Named("leftronic.accessKey")
  • @Named("leftronic.maxThreads")

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.

License

This project is licensed under the Apache 2.0 license.

leftronic-java's People

Contributors

lightbody avatar mateo41 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.