Guest User

Untitled

a guest
Feb 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. {
  2.  
  3. "xuid":****************,
  4. "state":"Online",
  5. "devices":[
  6. {
  7. "type":"XboxOne",
  8. "titles":[
  9. {
  10. "id":750323071,
  11. "name":"Accueil",
  12. "placement":"Background",
  13. "state":"Active",
  14. "lastModified":"2018-02-23T17:09:38.4018406Z"
  15. },
  16. {
  17. "id":1145574011,
  18. "activity":{
  19. "richPresence":"Dans un salon privu00e9"
  20. },
  21. "name":"Titanfallu2122 2",
  22. "placement":"Full",
  23. "state":"Active",
  24. "lastModified":"2018-02-23T17:09:38.4018406Z"
  25. }
  26. ]
  27. }
  28. ]
  29.  
  30. }
  31.  
  32. function (error, response, body) {
  33. if (!error && response.statusCode === 200) {
  34. var xbJson = JSON.parse(body);
  35. console.log(xbJson.devices.titles[1]['name'])
  36. }
  37. }
  38.  
  39. TypeError: Cannot read property '1' of undefined
  40. at Request._callback (/home/atmoner/Bureau/xboxlive/test.js:16:40)
  41. at Request.self.callback (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:186:22)
  42. at emitTwo (events.js:125:13)
  43. at Request.emit (events.js:213:7)
  44. at Request.<anonymous> (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:1163:10)
  45. at emitOne (events.js:115:13)
  46. at Request.emit (events.js:210:7)
  47. at IncomingMessage.<anonymous> (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:1085:12)
  48. at Object.onceWrapper (events.js:312:19)
  49. at emitNone (events.js:110:20)
Add Comment
Please, Sign In to add comment