littlebits / cloud-client-api-http

Lightweight wrapper for littleBits Cloud HTTP API
GNU General Public License v3.0
31 stars 10 forks source link

Add support for GET .../input #14

Open jasonkuhrt opened 9 years ago

jasonkuhrt commented 9 years ago

Add support for the new V3 API endpoint that allows for GETing a stream of input amplitude of a device.

This endpoint also supports https://github.com/littlebits/stream-sift features but because the endpoint is a GET the pattern spec must be sent as a urlEncoded value. This library should make this arcane and asinine process transparent to the user.

Also, what will the stream API we use be? Kefir? Custom?

stresslimit commented 9 years ago

@jasonkuhrt you mean urlencoded? encodeURIComponent()

jasonkuhrt commented 9 years ago

@stresslimit Ah right! Fixed.

apcosman commented 9 years ago

After spending Sat night/Sunday morning at the hackathon, i give this a big +1.

A subscription is absolutely a more elegant solution, but in a hacking situation you often need to go ugly, especially since web-code may not be your first language.

Also we need to have more verbose and easier to use curl examples in the docs, including of a GET input.

stresslimit commented 9 years ago

@alin-littlebits the best api docs are at https://github.com/littlebits/cloud-api-lessons, they include the input endpoint [which is currently broken but will be fixed today].