Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "xuid":****************,
- "state":"Online",
- "devices":[
- {
- "type":"XboxOne",
- "titles":[
- {
- "id":750323071,
- "name":"Accueil",
- "placement":"Background",
- "state":"Active",
- "lastModified":"2018-02-23T17:09:38.4018406Z"
- },
- {
- "id":1145574011,
- "activity":{
- "richPresence":"Dans un salon privu00e9"
- },
- "name":"Titanfallu2122 2",
- "placement":"Full",
- "state":"Active",
- "lastModified":"2018-02-23T17:09:38.4018406Z"
- }
- ]
- }
- ]
- }
- function (error, response, body) {
- if (!error && response.statusCode === 200) {
- var xbJson = JSON.parse(body);
- console.log(xbJson.devices.titles[1]['name'])
- }
- }
- TypeError: Cannot read property '1' of undefined
- at Request._callback (/home/atmoner/Bureau/xboxlive/test.js:16:40)
- at Request.self.callback (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:186:22)
- at emitTwo (events.js:125:13)
- at Request.emit (events.js:213:7)
- at Request.<anonymous> (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:1163:10)
- at emitOne (events.js:115:13)
- at Request.emit (events.js:210:7)
- at IncomingMessage.<anonymous> (/home/atmoner/Bureau/xboxlive/node_modules/request/request.js:1085:12)
- at Object.onceWrapper (events.js:312:19)
- at emitNone (events.js:110:20)
Add Comment
Please, Sign In to add comment