{"action":"created","comment":{"url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/comments/135012001","pull_request_review_id":58373779,"id":135012001,"diff_hunk":"@@ -0,0 +1,55 @@\n+\"use strict\";\n+\n+var http = require(\"http\");\n+\n+exports.callSusiApi = (slots, session, response) => {\n+    let query = slots.query.value,\n+        viewCount;\n+\n+    if(query === \"help\"){\n+        http.get(\"http://api.susi.ai/susi/chat.json?q=\"+\"Start+chatting\", (response1) => {\n+            var body = \"\";\n+            response1.on(\"data\", (chunk) => { body += chunk; });\n+            response1.on(\"end\", () => {\n+                var data = JSON.parse(body);\n+                viewCount = data.answers[0].actions[0].expression;\n+                response.say(viewCount,false);\n+            });\n+        });\n+    }\n+    else if (query === \"stop\" || query === \"cancel\"){\n+        viewCount = \"Ok, Susi.AI chatbot exiting\";\n+        response.say(viewCount,true);\n+    }\n+    else{\n+        var endpoint = \"http://api.susi.ai/susi/chat.json?q=\"+query; // ENDPOINT GOES HERE\n+\n+        http.get(endpoint, (response1) => {\n+            var body = \"\";\n+            response1.on(\"data\", (chunk) => { body += chunk; });\n+            response1.on(\"end\", function(){\n+                var data = JSON.parse(body);\n+                if(data.answers[0].actions[1]){\n+                    if(data.answers[0].actions[1].type === \"rss\"){","path":"handlers.js","position":33,"original_position":33,"commit_id":"2a17bde9bc265b55280d763f17ba59923e207396","original_commit_id":"2a17bde9bc265b55280d763f17ba59923e207396","user":{"login":"AliAyub007","id":25840461,"avatar_url":"https://avatars3.githubusercontent.com/u/25840461?v=4","gravatar_id":"","url":"https://api.github.com/users/AliAyub007","html_url":"https://github.com/AliAyub007","followers_url":"https://api.github.com/users/AliAyub007/followers","following_url":"https://api.github.com/users/AliAyub007/following{/other_user}","gists_url":"https://api.github.com/users/AliAyub007/gists{/gist_id}","starred_url":"https://api.github.com/users/AliAyub007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliAyub007/subscriptions","organizations_url":"https://api.github.com/users/AliAyub007/orgs","repos_url":"https://api.github.com/users/AliAyub007/repos","events_url":"https://api.github.com/users/AliAyub007/events{/privacy}","received_events_url":"https://api.github.com/users/AliAyub007/received_events","type":"User","site_admin":false},"body":"This can be done in one if else with && Codacy is showing that complexity is high here. ","created_at":"2017-08-24T13:20:01Z","updated_at":"2017-08-24T13:20:07Z","html_url":"https://github.com/fossasia/susi_alexa_skill/pull/8#discussion_r135012001","pull_request_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/comments/135012001"},"html":{"href":"https://github.com/fossasia/susi_alexa_skill/pull/8#discussion_r135012001"},"pull_request":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8","id":136551843,"html_url":"https://github.com/fossasia/susi_alexa_skill/pull/8","diff_url":"https://github.com/fossasia/susi_alexa_skill/pull/8.diff","patch_url":"https://github.com/fossasia/susi_alexa_skill/pull/8.patch","issue_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/8","number":8,"state":"open","locked":false,"title":"Made the SUSI Alexa skill an express app","user":{"login":"Manveer695","id":20307535,"avatar_url":"https://avatars0.githubusercontent.com/u/20307535?v=4","gravatar_id":"","url":"https://api.github.com/users/Manveer695","html_url":"https://github.com/Manveer695","followers_url":"https://api.github.com/users/Manveer695/followers","following_url":"https://api.github.com/users/Manveer695/following{/other_user}","gists_url":"https://api.github.com/users/Manveer695/gists{/gist_id}","starred_url":"https://api.github.com/users/Manveer695/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manveer695/subscriptions","organizations_url":"https://api.github.com/users/Manveer695/orgs","repos_url":"https://api.github.com/users/Manveer695/repos","events_url":"https://api.github.com/users/Manveer695/events{/privacy}","received_events_url":"https://api.github.com/users/Manveer695/received_events","type":"User","site_admin":false},"body":"Fixes #7 i.e. Changing Alexa skill to an express app. \r\nThe SUSI Alexa skill's dependency on Amazon web services removed.","created_at":"2017-08-18T19:47:24Z","updated_at":"2017-08-24T13:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc6f2c60f7a673c09e5225a6c2f4816d94c3be52","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8/commits","review_comments_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8/comments","review_comment_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/8/comments","statuses_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/statuses/2a17bde9bc265b55280d763f17ba59923e207396","head":{"label":"Manveer695:expressApp","ref":"expressApp","sha":"2a17bde9bc265b55280d763f17ba59923e207396","user":{"login":"Manveer695","id":20307535,"avatar_url":"https://avatars0.githubusercontent.com/u/20307535?v=4","gravatar_id":"","url":"https://api.github.com/users/Manveer695","html_url":"https://github.com/Manveer695","followers_url":"https://api.github.com/users/Manveer695/followers","following_url":"https://api.github.com/users/Manveer695/following{/other_user}","gists_url":"https://api.github.com/users/Manveer695/gists{/gist_id}","starred_url":"https://api.github.com/users/Manveer695/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manveer695/subscriptions","organizations_url":"https://api.github.com/users/Manveer695/orgs","repos_url":"https://api.github.com/users/Manveer695/repos","events_url":"https://api.github.com/users/Manveer695/events{/privacy}","received_events_url":"https://api.github.com/users/Manveer695/received_events","type":"User","site_admin":false},"repo":{"id":95544322,"name":"susi_alexa_skill","full_name":"Manveer695/susi_alexa_skill","owner":{"login":"Manveer695","id":20307535,"avatar_url":"https://avatars0.githubusercontent.com/u/20307535?v=4","gravatar_id":"","url":"https://api.github.com/users/Manveer695","html_url":"https://github.com/Manveer695","followers_url":"https://api.github.com/users/Manveer695/followers","following_url":"https://api.github.com/users/Manveer695/following{/other_user}","gists_url":"https://api.github.com/users/Manveer695/gists{/gist_id}","starred_url":"https://api.github.com/users/Manveer695/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manveer695/subscriptions","organizations_url":"https://api.github.com/users/Manveer695/orgs","repos_url":"https://api.github.com/users/Manveer695/repos","events_url":"https://api.github.com/users/Manveer695/events{/privacy}","received_events_url":"https://api.github.com/users/Manveer695/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Manveer695/susi_alexa_skill","description":"An alexa skill which can be used to ask susi for answers: \"Alexa, Ask Susi Who Are You\"","fork":true,"url":"https://api.github.com/repos/Manveer695/susi_alexa_skill","forks_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/forks","keys_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/teams","hooks_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/hooks","issue_events_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/issues/events{/number}","events_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/events","assignees_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/assignees{/user}","branches_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/branches{/branch}","tags_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/tags","blobs_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/git/refs{/sha}","trees_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/statuses/{sha}","languages_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/languages","stargazers_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/stargazers","contributors_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/contributors","subscribers_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/subscribers","subscription_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/subscription","commits_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/commits{/sha}","git_commits_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/git/commits{/sha}","comments_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/comments{/number}","issue_comment_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/issues/comments{/number}","contents_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/contents/{+path}","compare_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/merges","archive_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/downloads","issues_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/issues{/number}","pulls_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/pulls{/number}","milestones_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/milestones{/number}","notifications_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/labels{/name}","releases_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/releases{/id}","deployments_url":"https://api.github.com/repos/Manveer695/susi_alexa_skill/deployments","created_at":"2017-06-27T09:59:23Z","updated_at":"2017-06-28T05:11:21Z","pushed_at":"2017-08-24T09:49:17Z","git_url":"git://github.com/Manveer695/susi_alexa_skill.git","ssh_url":"git@github.com:Manveer695/susi_alexa_skill.git","clone_url":"https://github.com/Manveer695/susi_alexa_skill.git","svn_url":"https://github.com/Manveer695/susi_alexa_skill","homepage":null,"size":597,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fossasia:master","ref":"master","sha":"34903908404745c73a1c689d08f419d6b5f1726c","user":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"repo":{"id":95409949,"name":"susi_alexa_skill","full_name":"fossasia/susi_alexa_skill","owner":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fossasia/susi_alexa_skill","description":"An alexa skill which can be used to ask susi for answers: \"Alexa, Ask Susi Who Are You\"","fork":false,"url":"https://api.github.com/repos/fossasia/susi_alexa_skill","forks_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/forks","keys_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/teams","hooks_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/hooks","issue_events_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/events{/number}","events_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/events","assignees_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/assignees{/user}","branches_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/branches{/branch}","tags_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/tags","blobs_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/git/refs{/sha}","trees_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/statuses/{sha}","languages_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/languages","stargazers_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/stargazers","contributors_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/contributors","subscribers_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/subscribers","subscription_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/subscription","commits_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/commits{/sha}","git_commits_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/git/commits{/sha}","comments_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/comments{/number}","issue_comment_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/comments{/number}","contents_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/contents/{+path}","compare_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/merges","archive_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/downloads","issues_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues{/number}","pulls_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls{/number}","milestones_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/milestones{/number}","notifications_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/labels{/name}","releases_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/releases{/id}","deployments_url":"https://api.github.com/repos/fossasia/susi_alexa_skill/deployments","created_at":"2017-06-26T04:59:45Z","updated_at":"2017-08-22T11:54:33Z","pushed_at":"2017-08-24T09:49:18Z","git_url":"git://github.com/fossasia/susi_alexa_skill.git","ssh_url":"git@github.com:fossasia/susi_alexa_skill.git","clone_url":"https://github.com/fossasia/susi_alexa_skill.git","svn_url":"https://github.com/fossasia/susi_alexa_skill","homepage":null,"size":569,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8"},"html":{"href":"https://github.com/fossasia/susi_alexa_skill/pull/8"},"issue":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/8"},"comments":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/fossasia/susi_alexa_skill/statuses/2a17bde9bc265b55280d763f17ba59923e207396"}}}}
{"actor":{"display_login":"AliAyub007"}}