Command Line

If you’d like to push data from a command line interface, you can use the cURL tool to send data to your widget.

Number, Horizontal/Vertical Bar, Dial Widgets:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": 42}' https://www.leftronic.com/customSend/
 
# Or, you can add an optional prefix/suffix/timestamp key. In this case, the "number" key is required:
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"prefix": "$", "number": 33}}' https://www.leftronic.com/customSend/
 
# Or you can send a "delta" key instead of a "number" key. This will add to (or subtract from) the latest number in the stream.
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"prefix": "$", "delta": 299}}' https://www.leftronic.com/customSend/

USA Map, World Map Widgets:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"latitude": -81.98, "longitude": 11.70}}' https://www.leftronic.com/customSend/
# Or choose a color for your map point
# (red, blue, green, purple, and yellow only)
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"latitude": -81.98, "longitude": 11.70, "color": "blue"}}' https://www.leftronic.com/customSend/

Text Feed Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"title": "myTitle", "msg": "myMsg"}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>
 
# Or add an image URL to the text feed:
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"title": "myTitle", "msg": "myMsg", "imgUrl": "http://goo.gl/uqHsk"}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>

Leaderboard, Pie Chart, Bar Chart Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"leaderboard": [{"name": "Cheryl", "value": 57}, {"name": "Megan", "value": 32}, {"name": "Marisa", "value": 23}, {"name": "Frankie", "value": 11}, {"name": "Keeley", "value": 7}, {"name": "Kristen", "value": 3}, {"name": "Kelly", "value": 3}]}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>
 
# Or add an optional prefix or suffix key per leaderboard element:
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"leaderboard": [{"name": "Cheryl", "value": 57, "suffix": "%"}, {"name": "Megan", "value": 32, "suffix": "%"}, {"name": "Marisa", "value": 23, "suffix": "%"}]}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>
 
# Or add an optional color key per bar chart element:
 
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"chart": [{"name": "Cheryl", "value": 57, "color": "yellow"}, {"name": "Megan", "value": 32, "color": "blue"}, {"name": "Marisa", "value": 23, "color": "red"}]}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>

You can also add a single item to an existing leaderboard, as follows:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"leaderboardItem": {"name": "Nigel", "value": 2150}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>

List Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"list": [{"listItem": "Cheryl"}, {"listItem": "Megan"}, {"listItem": "Marisa"}, {"listItem": "Frankie"}, {"listItem": "Keeley"}, {"listItem": "Kristen"}, {"listItem": "Kelly"}]}}' <a href="https://www.leftronic.com/customSend/">https://www.leftronic.com/customSend/</a>

You can also push a single list item at a time, which will push that item to the top of an already existing list:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"listItem": "Celebrate good times"}}' https://www.leftronic.com/customSend/

Image Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"imgUrl": "http://goo.gl/uqHsk"}}' https://www.leftronic.com/customSend/

Label Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"label": "In search of 1988"}}' https://www.leftronic.com/customSend/

Table Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"table": [ ["header1", "header2"], ["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"] ]}}' https://www.leftronic.com/customSend/ You can push a single row at a time to an already existing table. This will append the row to the top of the table:
curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"tableRow": ["Value 1", "Value 2"]}}' https://www.leftronic.com/customSend/

Gallery Widget:

The “msg” parameter is optional.

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"title": "myTitle", "msg": "myMsg", "imgUrl":"http://goo.gl/uqHsk"}}' https://www.leftronic.com/customSend/

HTML Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"html": "<H3>Hello world!</H3>"} }' https://www.leftronic.com/customSend/

XY Graph Widget:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"x": 16, "y": 32}}' https://www.leftronic.com/customSend/

Array of XY Pairs (Use for X-Y Graph):

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": [{"x": 16, "y": 32}, {"x": 30, "y": 60}]}' https://www.leftronic.com/customSend/

Map, text feed, and sparkline/line graph widgets can also take arrays of data in a similar way. If passing an array of numbers to a sparkline or line graph, each number will require a UTC timestamp as well, and these must be passed in ascending order.

Multi-bar Graph Widget (array of arrays):

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "point": {"matrix":[["Years","Barcelona","Real Madrid","Atlético"],["2010",95,102,62],["2011",114,121,53],["2012",115,103,65],["2013",100,104,77]]}}' https://www.leftronic.com/customSend/

Note that the first element of the first array is not displayed and you can use an empty string if desired.

Programmatically clear widgets:

The Sparkline/Line Graph, Map, Text Feed, and XY Graph widgets can be cleared with a ‘clear’ command.

The others can be cleared by pushing an empty point.

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streamName": "yourStreamName", "command": "clear"}' https://www.leftronic.com/customSend/

Note that this wipes out all the data in this widget!

Pushing to multiple streams at once:

curl -X POST -d '{"accessKey": "bGVmdHJvbmljaXNhd2Vz", "streams": [ { "streamName": "mynumber", "point": 35 }, { "streamName": "mymap", "point": [ { "latitude": 22.3, "longitude": 114.2 }, { "latitude": 48.9, "longitude": 2.35, "color": "green" } ] } ]}' https://www.leftronic.com/customSend/

Working with proxy servers:

If you use a proxy server, you may need to use the following switches within your command:

-x <proxy server> --proxy-<basic, anyauth, etc.>

For example:

curl -X POST –x  --proxy-anyauth https://www.leftronic.com/customSend/ -d "{"accessKey": "YOUR_ACCESS_KEY", "streamName": "yourStreamName", "point": 42}"

Working in Microsoft Windows:

When using the cURL command in Microsoft Windows, you may need to escape the double quotes (“) by including a backslash (\) before each double quote: 

curl -x POST https://www.leftronic.com/customSend -d "{\"accessKey\": \"YOUR_ACCESS_KEY\", \"streamName\": \"yourStreamName\", \"point\": 42}"