Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. {
  2. "id": "1e003033",
  3. "name": "camera",
  4. "last_app": null,
  5. "last_ip_address": "192.168.0.27",
  6. "last_heard": "2016-08-27T14:22:49.762Z",
  7. "product_id": 6,
  8. "connected": true,
  9. "platform_id": 6,
  10. "cellular": false,
  11. "status": "normal",
  12. "pinned_build_target": "0.5.2",
  13. "variables": {
  14. "lonlat": "string",
  15. "speedmph": "string",
  16. "sats": "string"
  17. },
  18. "functions": []
  19. }
  20.  
  21. requestURL_O = "https://api.spark.io/v1/devices/" + deviceID + "/?access_token=" + accessToken;
  22. $.getJSON(requestURL_O, function(jonline){
  23. console.log(jonline.connected);
  24. jstr = jonline.connect;
  25. console.log(jstr);
  26. if (jstr == "true"){
  27. online_status = true;
  28. console.log("equal = TRUE");
  29. }
  30. else {
  31. online_status = false;
  32. jstr = jonline.last_heard;
  33. console.log(jonline.last_heard);
  34. console.log("equal = FALSE");
  35. }
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement