Command Line

Start by downloading the most recent version of our PHP API on Github.

Create a class instance with your Access Key:

$update = new Leftronic("YOUR_ACCESS_KEY");
/* Make sure the CAcerts folder in the Github repo is in
the same path as the .php file *

Try pushing to your dashboard with some of these functions, substituting the names of your custom widgets.

/* Example: push a number to a widget */
$update->pushNumber("yourNumberStream", 14600);
 
/* Example: push a location to a map widget */
$update->pushGeo("yourGeoStream", 37.8, -122.6);
 
/* Or choose a color for your map point (red, blue, green,
purple, and yellow only) */
$update->pushGeo("yourGeoStream", 37.8, -122.6, "blue");
 
/* Example: push a title and message to a text feed widget */
$update->pushText("yourTextStream", "This is my title.",
    "Hello World!");
 
/* Example: push an array to a leaderboard widget */
$leaderArray = array(array("name" => "Johnny", "value" => 84),
    array("name" => "Jamie", "value" => 75),
    array("name" => "Lance", "value" => 62));
$update->pushLeaderboard("yourBoardStream", $leaderArray);
 
/* Example: push an array to a list widget */
$listArray = array(array("listItem" => "Elizabeth"),
    array("listItem" => "Marshall"),
    array("listItem" => "Claire"),
    array("listItem" => "Nolan"));
$update->pushList("yourListStream", $listArray);
 
/* Example: push an image URL */
$update->pushImage("yourImageStream", "http://goo.gl/uqHsk");
 
/* Example: push a label */
$update->pushLabel("yourLabelStream", "This is my label");
 
/* Example: push table data */
$headerRow = array("Col 1", "Col 2", "Col 3");
$tableRows = array(array(1, 2, 3),
    array("John", "James", "Cindy"));
$update->pushTable("yourTableStream", $headerRow, $tableRows);
 
/* Example: push to an HTML widget */
$html = "<html><body>Hello!</body></html>";
$update->pushHtml("yourHtmlStream", $html);
 
/* Example: push to an XY graph widget */
$x = array(1, 2, 3);
$y = array(4, 5, 6);
$update->pushPair("yourXYStream", $x, $y);
 
/* Example: clear a widget */
$update->clear("streamToClear");