{"action":"opened","issue":{"url":"https://api.github.com/repos/twilio/twilio-node/issues/126","labels_url":"https://api.github.com/repos/twilio/twilio-node/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/twilio/twilio-node/issues/126/comments","events_url":"https://api.github.com/repos/twilio/twilio-node/issues/126/events","html_url":"https://github.com/twilio/twilio-node/issues/126","id":110201991,"number":126,"title":"TypeError: Cannot read property 'sid' of undefined","user":{"login":"rhys-edwards","id":6435583,"avatar_url":"https://avatars.githubusercontent.com/u/6435583?v=3","gravatar_id":"","url":"https://api.github.com/users/rhys-edwards","html_url":"https://github.com/rhys-edwards","followers_url":"https://api.github.com/users/rhys-edwards/followers","following_url":"https://api.github.com/users/rhys-edwards/following{/other_user}","gists_url":"https://api.github.com/users/rhys-edwards/gists{/gist_id}","starred_url":"https://api.github.com/users/rhys-edwards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhys-edwards/subscriptions","organizations_url":"https://api.github.com/users/rhys-edwards/orgs","repos_url":"https://api.github.com/users/rhys-edwards/repos","events_url":"https://api.github.com/users/rhys-edwards/events{/privacy}","received_events_url":"https://api.github.com/users/rhys-edwards/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-07T11:10:55Z","updated_at":"2015-10-07T11:10:55Z","closed_at":null,"body":"Being thrown the above error whilst trying to use the code from the Node.JS API explorer in Twilio dev tools. \r\n\r\nError:\r\n````\r\n7 Oct 22:01:52 - [nodemon] starting `node scraper.js`\r\nFree on Xbox One, Xbox 360, PS3, PS4: Tales from the Borderlands (Episode 1)\r\n/Users/rhysedwards/Downloads/insightful/ozbargain/node_modules/twilio/node_modules/q/q.js:126\r\n                    throw e;\r\n                    ^\r\n\r\nTypeError: Cannot read property 'sid' of undefined\r\n    at /Users/rhysedwards/Downloads/insightful/ozbargain/scraper.js:22:31\r\n    at /Users/rhysedwards/Downloads/insightful/ozbargain/node_modules/twilio/node_modules/q/q.js:1924:17\r\n    at flush (/Users/rhysedwards/Downloads/insightful/ozbargain/node_modules/twilio/node_modules/q/q.js:108:17)\r\n    at doNTCallback0 (node.js:408:9)\r\n    at process._tickCallback (node.js:337:13)\r\n7 Oct 22:01:54 - [nodemon] app crashed - waiting for file changes before starting...\r\n````\r\n\r\nCode:\r\n````\r\nvar accountSid = 'A********';\r\nvar authToken = 'd*********';\r\n\r\nvar fs = require('fs'),\r\n    request = require('request'),\r\n    cheerio = require('cheerio'),\r\n    client = require('twilio')(accountSid, authToken);\r\n\r\nurl = 'http://www.ozbargain.com.au';\r\n\r\nrequest(url, function(error, response, html) {\r\n    if (!error && response.statusCode == 200) {\r\n        var $ = cheerio.load(html);\r\n        var $el = $(\"a:contains('Xbox')\");\r\n\r\n        if ($el.length) {\r\n          client.messages.create({\r\n          \tto: \"61448141065\",\r\n          \tfrom: \"61418739508\",\r\n          \tbody: \"hey\",\r\n          }, function(err, message) {\r\n          \tconsole.log(message.sid);\r\n          });\r\n            console.log($el.text());\r\n        } else {\r\n            console.log('hey');\r\n        }\r\n    }\r\n});\r\n\r\n````"}}