{"action":"created","issue":{"url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/9","labels_url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/9/comments","events_url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/9/events","html_url":"https://github.com/Doodle3D/Doodle3D-API/issues/9","id":96832052,"number":9,"title":"Restructure?","user":{"login":"peteruithoven","id":523210,"avatar_url":"https://avatars.githubusercontent.com/u/523210?v=3","gravatar_id":"","url":"https://api.github.com/users/peteruithoven","html_url":"https://github.com/peteruithoven","followers_url":"https://api.github.com/users/peteruithoven/followers","following_url":"https://api.github.com/users/peteruithoven/following{/other_user}","gists_url":"https://api.github.com/users/peteruithoven/gists{/gist_id}","starred_url":"https://api.github.com/users/peteruithoven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteruithoven/subscriptions","organizations_url":"https://api.github.com/users/peteruithoven/orgs","repos_url":"https://api.github.com/users/peteruithoven/repos","events_url":"https://api.github.com/users/peteruithoven/events{/privacy}","received_events_url":"https://api.github.com/users/peteruithoven/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-23T14:48:50Z","updated_at":"2015-07-24T12:28:51Z","closed_at":null,"body":"If we include the connect API (#8) it might make sense to restructure the library slightly. \r\n\r\n``` javascript\r\nvar d3d = new Doodle3DAPI();\r\nd3d.refresh(); // or d3d.autoRefresh()\r\nd3d.on(\"boxAppeared\",(box) => {\r\n  // includes box.id retrieved from connect.doodle3d.com\r\n  console.log(`New Doodle3D WiFi-Box found: '${box.id}' with ip: '${box.ip} '`);\r\n  box.printer.print(\"G1 X1 X2\");\r\n  box.info.autoRefresh();\r\n  box.info.on(\"status\",(status) => {\r\n    console.log(`${box.id} status: `,status);\r\n  });\r\n})\r\n```\r\nOr skipping our connect api: \r\n``` javascript\r\nvar d3d = new Doodle3DAPI();\r\nvar box = d3d.getBox(\"192.168.5.1\"); // box.id not (yet) available. Maybe we can do a separate request to the box to fill this in? \r\nbox.info.autoRefresh();\r\nbox.info.on(\"status\",(status) => {\r\n  var id = box.id? box.id : box.ip;\r\n  console.log(`${id} status: `, status);\r\n});\r\n```\r\n\r\nMore inspiration: \r\n- Github: https://github.com/michael/github (from: https://developer.github.com/libraries/)\r\n- Facebook: https://developers.facebook.com/docs/javascript/reference/v2.4\r\n- ChromeCast: https://github.com/pjjanak/chromecast-hello-world\r\n- Stack overflow: https://www.npmjs.com/package/stackexchange"},"comment":{"url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/comments/124503751","html_url":"https://github.com/Doodle3D/Doodle3D-API/issues/9#issuecomment-124503751","issue_url":"https://api.github.com/repos/Doodle3D/Doodle3D-API/issues/9","id":124503751,"user":{"login":"peteruithoven","id":523210,"avatar_url":"https://avatars.githubusercontent.com/u/523210?v=3","gravatar_id":"","url":"https://api.github.com/users/peteruithoven","html_url":"https://github.com/peteruithoven","followers_url":"https://api.github.com/users/peteruithoven/followers","following_url":"https://api.github.com/users/peteruithoven/following{/other_user}","gists_url":"https://api.github.com/users/peteruithoven/gists{/gist_id}","starred_url":"https://api.github.com/users/peteruithoven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteruithoven/subscriptions","organizations_url":"https://api.github.com/users/peteruithoven/orgs","repos_url":"https://api.github.com/users/peteruithoven/repos","events_url":"https://api.github.com/users/peteruithoven/events{/privacy}","received_events_url":"https://api.github.com/users/peteruithoven/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T12:28:51Z","updated_at":"2015-07-24T12:28:51Z","body":"But the manager doesn't ask the box whether it's alive? It's a check the user of the api needs to do manually? "}}