{"action":"created","issue":{"url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/7","repository_url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv","labels_url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/7/comments","events_url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/7/events","html_url":"https://github.com/bklavet/Echo-skill-to-control-Directv/issues/7","id":160482184,"number":7,"title":"getTuned getProgInfo...","user":{"login":"bklavet","id":9345832,"avatar_url":"https://avatars.githubusercontent.com/u/9345832?v=3","gravatar_id":"","url":"https://api.github.com/users/bklavet","html_url":"https://github.com/bklavet","followers_url":"https://api.github.com/users/bklavet/followers","following_url":"https://api.github.com/users/bklavet/following{/other_user}","gists_url":"https://api.github.com/users/bklavet/gists{/gist_id}","starred_url":"https://api.github.com/users/bklavet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bklavet/subscriptions","organizations_url":"https://api.github.com/users/bklavet/orgs","repos_url":"https://api.github.com/users/bklavet/repos","events_url":"https://api.github.com/users/bklavet/events{/privacy}","received_events_url":"https://api.github.com/users/bklavet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-15T17:43:38Z","updated_at":"2016-09-15T16:43:03Z","closed_at":null,"body":"Maybe someone can help with this.  I think it would be great to be able to ask alexa to retrieve the current program info (getTuned) and have the lambda function parse the JSON response and send the parsed information back to alexa.\r\nexp. Get Tuned - http://STBIP:port/tv/getTuned\r\n\r\nI think there would also be some added value to be able to ask about other program information without changing to that channel, (getProgInfo).  I would like to eventually be able to ask about program information based on time. exp. \"what is on CNN/202 at 10:00 today?\"\r\nGet Program Info - http://STBIP:port/tv/getProgInfo?major=202[&minor=65535][&time=2200]\r\n\r\nI am not sure how to parse the response, Does anyone have any ideas on how?"},"comment":{"url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/comments/247383144","html_url":"https://github.com/bklavet/Echo-skill-to-control-Directv/issues/7#issuecomment-247383144","issue_url":"https://api.github.com/repos/bklavet/Echo-skill-to-control-Directv/issues/7","id":247383144,"user":{"login":"bklavet","id":9345832,"avatar_url":"https://avatars.githubusercontent.com/u/9345832?v=3","gravatar_id":"","url":"https://api.github.com/users/bklavet","html_url":"https://github.com/bklavet","followers_url":"https://api.github.com/users/bklavet/followers","following_url":"https://api.github.com/users/bklavet/following{/other_user}","gists_url":"https://api.github.com/users/bklavet/gists{/gist_id}","starred_url":"https://api.github.com/users/bklavet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bklavet/subscriptions","organizations_url":"https://api.github.com/users/bklavet/orgs","repos_url":"https://api.github.com/users/bklavet/repos","events_url":"https://api.github.com/users/bklavet/events{/privacy}","received_events_url":"https://api.github.com/users/bklavet/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T16:43:03Z","updated_at":"2016-09-15T16:43:03Z","body":"found a cool video on youtube:\r\n\r\nand was looking at modifying this to maybe get the desired affect\r\n\r\n case \"GetVideoViewCountSinceDate\":\r\n            console.log(event.request.intent.slots.SinceDate.value)\r\n            var endpoint = \"\" // ENDPOINT GOES HERE\r\n            var body = \"\"\r\n            https.get(endpoint, (response) => {\r\n              response.on('data', (chunk) => { body += chunk })\r\n              response.on('end', () => {\r\n                var data = JSON.parse(body)\r\n                var viewCount = data.items[0].statistics.viewCount\r\n                context.succeed(\r\n                  generateResponse(\r\n                    buildSpeechletResponse(`Current view count is ${viewCount}`, true),\r\n                    {}\r\n                  )\r\n                )\r\n              })\r\n            })\r\n            break;\r\n\r\nfor the /tv/getTuned command, this comes back from the reciever (note my receiver was not on so nothing showed up, but this is the format of the JS response\r\n{\r\n  \"callsign\": \"\",\r\n  \"duration\": 0,\r\n  \"isPclocked\": 0,\r\n  \"isPpv\": false,\r\n  \"isRecording\": false,\r\n  \"isVod\": false,\r\n  \"major\": 0,\r\n  \"minor\": 0,\r\n  \"programId\": \"\",\r\n  \"rating\": \"\",\r\n  \"startTime\": 0,\r\n  \"status\": {\r\n    \"code\": 500,\r\n    \"commandResult\": 1,\r\n    \"msg\": \"The requested program does not exist.\",\r\n    \"query\": \"/tv/getTuned\"\r\n  },\r\n  \"title\": \"\"\r\n}\r\n\r\nSo maybe the getTuned argument could look something like this?\r\ncase \"what is this\":\r\n            console.log(event.request.intent.slots.Program.value)\r\n            var endpoint = \"/tv/getTuned\" // ENDPOINT GOES HERE\r\n            var body = \"\"\r\nvar options = {\r\n                     host: local_ip,\r\n                     port: 8080, // default port for DTV interface\r\n                     path: '' + endpoint, // Modify if path is prefixed \r\n                     method: 'GET'\r\n                    }\r\n            http.get(endpoint, (response) => {\r\n              response.on('data', (chunk) => { body += chunk })\r\n              response.on('end', () => {\r\n                var data = JSON.parse(body)\r\n                var title = data.items[0].title\r\n                context.succeed(\r\n                  generateResponse(\r\n                    buildSpeechletResponse(`Current view count is ${title}`, true),\r\n                    {}\r\n                  )\r\n                )\r\n              })\r\n            })\r\n            break;\r\n\r\nWould something along these lines produce the title of the current program?\r\nany help would be appreciated greatly!"}}
{"actor":{"display_login":"bklavet"}}