REST API Wrapper around some Baby Connect functionality using nightmare.js.
I love the Baby Connect app. I wanted a way to use it from my Pebble, but unfortunately they don't offer an API. So I decided to make my own! All it does it provide a few simple commands, all triggered via commands run via nightmare.js.
You'll need to deploy this somewhere to use it. There are lots of places to deploy a node.js app for cheap (note: I found that some places had trouble running nightmarejs).
Because this isn't a real API, it is fragile and could break anytime the baby connect site changes. So use at your own risk!
Since you are passing email and password in the requests, you'll probably want to make sure your site uses SSL.
Check out the repo and run:
npm install
.
To start the web server, run:
node index.js
.
The API should then be available at http://localhost:3000
.
If something goes wrong with nightmare.js, it will return a 500
status and the error, like:
{ "error" : "This thing went wrong" }
Gets list of kids in your account with their ids, to be used in other requests.
GET /kids?email=something@something.com&password=password
Example Response:
[{
"id": "kid124567890",
"name": "Bob"
}]
Enters a diaper change at the current time.
POST /diaper
Example:
{
"email": "something@something.com",
"password": "password",
"kidId": "kid124567890",
"type": "bm"
}
Type is one of 'bm', 'bmWet', or 'wet'.
Enters a bottle taken at the current time.
POST /bottle
Example:
{
"email": "something@something.com",
"password": "password",
"kidId": "kid124567890",
"type": "formula",
"quantity": 2
}
Type is one of 'formula' or 'milk'.
Quantity is a value in ounces.