{"action":"created","comment":{"url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/comments/173152575","pull_request_review_id":102287781,"id":173152575,"diff_hunk":"@@ -0,0 +1,192 @@\n+from uqcsbot import bot, Command\n+from typing import Iterable, Tuple\n+import requests\n+import json\n+\n+APP_ID = \"UVKV2V-5XW2TETT69\"\n+\n+# IDEA: Show the assumptions made?\n+# TODO: Better naming of commands\n+@bot.on_command(\"wolframfull\")\n+async def handle_wolframfull(command: Command):\n+    \"\"\"\n+    This posts the full results from wolfram query. Images and all\n+\n+    Example usage:\n+    !wolframfull y = 2x + c\n+    \"\"\"\n+    api_url = r\"http://api.wolframalpha.com/v2/query?&output=json\"\n+    search_query = command.arg\n+    http_response = await bot.run_async(requests.get, api_url, params={'input': search_query, 'appid': APP_ID})\n+\n+    # Check if the response is ok\n+    if http_response.status_code != requests.codes.ok:\n+        bot.post_message(command.channel, \"There was a problem getting the response\")\n+        return\n+\n+    # Get the result of the query and determine if wolfram succeeded in evaluating it\n+    result = json.loads(http_response.content)['queryresult']\n+    if not result['success'] or result[\"error\"]:\n+        bot.post_message(command.channel, \"Please rephrase your query. Wolfram could not compute.\")\n+\n+    subpods = get_subpods(result['pods'])\n+    message = \"\"\n+    for title, subpod in subpods:","path":"uqcsbot/scripts/wolfram.py","position":34,"original_position":34,"commit_id":"31878a8db3928d7664f4e6bdd720a533e9714c00","original_commit_id":"31878a8db3928d7664f4e6bdd720a533e9714c00","user":{"login":"mitchmcdee","id":10495244,"avatar_url":"https://avatars1.githubusercontent.com/u/10495244?v=4","gravatar_id":"","url":"https://api.github.com/users/mitchmcdee","html_url":"https://github.com/mitchmcdee","followers_url":"https://api.github.com/users/mitchmcdee/followers","following_url":"https://api.github.com/users/mitchmcdee/following{/other_user}","gists_url":"https://api.github.com/users/mitchmcdee/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchmcdee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchmcdee/subscriptions","organizations_url":"https://api.github.com/users/mitchmcdee/orgs","repos_url":"https://api.github.com/users/mitchmcdee/repos","events_url":"https://api.github.com/users/mitchmcdee/events{/privacy}","received_events_url":"https://api.github.com/users/mitchmcdee/received_events","type":"User","site_admin":false},"body":"I wouldn't bother extracting subpods into its own variable-- just inline the generator","created_at":"2018-03-08T13:11:21Z","updated_at":"2018-03-08T13:41:46Z","html_url":"https://github.com/UQComputingSociety/uqcsbot/pull/263#discussion_r173152575","pull_request_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/comments/173152575"},"html":{"href":"https://github.com/UQComputingSociety/uqcsbot/pull/263#discussion_r173152575"},"pull_request":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263"}}},"pull_request":{"url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263","id":173721692,"html_url":"https://github.com/UQComputingSociety/uqcsbot/pull/263","diff_url":"https://github.com/UQComputingSociety/uqcsbot/pull/263.diff","patch_url":"https://github.com/UQComputingSociety/uqcsbot/pull/263.patch","issue_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/263","number":263,"state":"open","locked":false,"title":"Added !wolfram and !wolframfull commands","user":{"login":"mubiquity","id":24851062,"avatar_url":"https://avatars1.githubusercontent.com/u/24851062?v=4","gravatar_id":"","url":"https://api.github.com/users/mubiquity","html_url":"https://github.com/mubiquity","followers_url":"https://api.github.com/users/mubiquity/followers","following_url":"https://api.github.com/users/mubiquity/following{/other_user}","gists_url":"https://api.github.com/users/mubiquity/gists{/gist_id}","starred_url":"https://api.github.com/users/mubiquity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubiquity/subscriptions","organizations_url":"https://api.github.com/users/mubiquity/orgs","repos_url":"https://api.github.com/users/mubiquity/repos","events_url":"https://api.github.com/users/mubiquity/events{/privacy}","received_events_url":"https://api.github.com/users/mubiquity/received_events","type":"User","site_admin":false},"body":"Two commands that interface with the wolfram api in different ways. !wolframfull returns all of the results you would get from any regular query into wolfram.\r\n\r\nExamples:\r\n![wolframfull](https://user-images.githubusercontent.com/24851062/37150402-47874210-231d-11e8-9706-3c0c34163320.PNG)\r\n\r\n!wolfram on the other hand returns just a short text response that can usually be replied to. For example:\r\n\r\n![wolfram1](https://user-images.githubusercontent.com/24851062/37150741-90a280bc-231e-11e8-8105-60d58aaffee1.PNG)\r\n![wolfram2](https://user-images.githubusercontent.com/24851062/37150742-90dcb3ae-231e-11e8-85d8-caba238454b4.PNG)\r\n![wolfram3](https://user-images.githubusercontent.com/24851062/37150744-911472f8-231e-11e8-90e7-c3a4fab53582.PNG)\r\n![wolfram4](https://user-images.githubusercontent.com/24851062/37150745-9149baee-231e-11e8-9d77-ffdf4e7e0229.PNG)\r\n\r\nIf Wolfram cannot come up with a conversation for that question (seems to be a rare case) then a short answer is instead supplied using their short answers API. \r\n\r\nThe app id you get from wolfram is free for less than 2000 requests a month which I doubt would ever be exceeded.","created_at":"2018-03-08T12:20:16Z","updated_at":"2018-03-08T13:41:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"811699971317e787087aa8be33c126ea022f0833","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263/commits","review_comments_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263/comments","review_comment_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/263/comments","statuses_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/statuses/31878a8db3928d7664f4e6bdd720a533e9714c00","head":{"label":"mubiquity:wolfram_changes","ref":"wolfram_changes","sha":"31878a8db3928d7664f4e6bdd720a533e9714c00","user":{"login":"mubiquity","id":24851062,"avatar_url":"https://avatars1.githubusercontent.com/u/24851062?v=4","gravatar_id":"","url":"https://api.github.com/users/mubiquity","html_url":"https://github.com/mubiquity","followers_url":"https://api.github.com/users/mubiquity/followers","following_url":"https://api.github.com/users/mubiquity/following{/other_user}","gists_url":"https://api.github.com/users/mubiquity/gists{/gist_id}","starred_url":"https://api.github.com/users/mubiquity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubiquity/subscriptions","organizations_url":"https://api.github.com/users/mubiquity/orgs","repos_url":"https://api.github.com/users/mubiquity/repos","events_url":"https://api.github.com/users/mubiquity/events{/privacy}","received_events_url":"https://api.github.com/users/mubiquity/received_events","type":"User","site_admin":false},"repo":{"id":123794277,"name":"uqcsbot","full_name":"mubiquity/uqcsbot","owner":{"login":"mubiquity","id":24851062,"avatar_url":"https://avatars1.githubusercontent.com/u/24851062?v=4","gravatar_id":"","url":"https://api.github.com/users/mubiquity","html_url":"https://github.com/mubiquity","followers_url":"https://api.github.com/users/mubiquity/followers","following_url":"https://api.github.com/users/mubiquity/following{/other_user}","gists_url":"https://api.github.com/users/mubiquity/gists{/gist_id}","starred_url":"https://api.github.com/users/mubiquity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubiquity/subscriptions","organizations_url":"https://api.github.com/users/mubiquity/orgs","repos_url":"https://api.github.com/users/mubiquity/repos","events_url":"https://api.github.com/users/mubiquity/events{/privacy}","received_events_url":"https://api.github.com/users/mubiquity/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mubiquity/uqcsbot","description":"UQCSbot: our friendly little Slack bot","fork":true,"url":"https://api.github.com/repos/mubiquity/uqcsbot","forks_url":"https://api.github.com/repos/mubiquity/uqcsbot/forks","keys_url":"https://api.github.com/repos/mubiquity/uqcsbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mubiquity/uqcsbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mubiquity/uqcsbot/teams","hooks_url":"https://api.github.com/repos/mubiquity/uqcsbot/hooks","issue_events_url":"https://api.github.com/repos/mubiquity/uqcsbot/issues/events{/number}","events_url":"https://api.github.com/repos/mubiquity/uqcsbot/events","assignees_url":"https://api.github.com/repos/mubiquity/uqcsbot/assignees{/user}","branches_url":"https://api.github.com/repos/mubiquity/uqcsbot/branches{/branch}","tags_url":"https://api.github.com/repos/mubiquity/uqcsbot/tags","blobs_url":"https://api.github.com/repos/mubiquity/uqcsbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mubiquity/uqcsbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mubiquity/uqcsbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/mubiquity/uqcsbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mubiquity/uqcsbot/statuses/{sha}","languages_url":"https://api.github.com/repos/mubiquity/uqcsbot/languages","stargazers_url":"https://api.github.com/repos/mubiquity/uqcsbot/stargazers","contributors_url":"https://api.github.com/repos/mubiquity/uqcsbot/contributors","subscribers_url":"https://api.github.com/repos/mubiquity/uqcsbot/subscribers","subscription_url":"https://api.github.com/repos/mubiquity/uqcsbot/subscription","commits_url":"https://api.github.com/repos/mubiquity/uqcsbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/mubiquity/uqcsbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/mubiquity/uqcsbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/mubiquity/uqcsbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/mubiquity/uqcsbot/contents/{+path}","compare_url":"https://api.github.com/repos/mubiquity/uqcsbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mubiquity/uqcsbot/merges","archive_url":"https://api.github.com/repos/mubiquity/uqcsbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mubiquity/uqcsbot/downloads","issues_url":"https://api.github.com/repos/mubiquity/uqcsbot/issues{/number}","pulls_url":"https://api.github.com/repos/mubiquity/uqcsbot/pulls{/number}","milestones_url":"https://api.github.com/repos/mubiquity/uqcsbot/milestones{/number}","notifications_url":"https://api.github.com/repos/mubiquity/uqcsbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mubiquity/uqcsbot/labels{/name}","releases_url":"https://api.github.com/repos/mubiquity/uqcsbot/releases{/id}","deployments_url":"https://api.github.com/repos/mubiquity/uqcsbot/deployments","created_at":"2018-03-04T14:04:03Z","updated_at":"2018-03-04T14:04:05Z","pushed_at":"2018-03-08T11:52:15Z","git_url":"git://github.com/mubiquity/uqcsbot.git","ssh_url":"git@github.com:mubiquity/uqcsbot.git","clone_url":"https://github.com/mubiquity/uqcsbot.git","svn_url":"https://github.com/mubiquity/uqcsbot","homepage":"https://slack.uqcs.org.au","size":452,"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,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"python-rewrite"}},"base":{"label":"UQComputingSociety:python-rewrite","ref":"python-rewrite","sha":"83f58cb2adbbb0f62ebf2d5c57bbf3642a709196","user":{"login":"UQComputingSociety","id":639595,"avatar_url":"https://avatars1.githubusercontent.com/u/639595?v=4","gravatar_id":"","url":"https://api.github.com/users/UQComputingSociety","html_url":"https://github.com/UQComputingSociety","followers_url":"https://api.github.com/users/UQComputingSociety/followers","following_url":"https://api.github.com/users/UQComputingSociety/following{/other_user}","gists_url":"https://api.github.com/users/UQComputingSociety/gists{/gist_id}","starred_url":"https://api.github.com/users/UQComputingSociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UQComputingSociety/subscriptions","organizations_url":"https://api.github.com/users/UQComputingSociety/orgs","repos_url":"https://api.github.com/users/UQComputingSociety/repos","events_url":"https://api.github.com/users/UQComputingSociety/events{/privacy}","received_events_url":"https://api.github.com/users/UQComputingSociety/received_events","type":"Organization","site_admin":false},"repo":{"id":46210727,"name":"uqcsbot","full_name":"UQComputingSociety/uqcsbot","owner":{"login":"UQComputingSociety","id":639595,"avatar_url":"https://avatars1.githubusercontent.com/u/639595?v=4","gravatar_id":"","url":"https://api.github.com/users/UQComputingSociety","html_url":"https://github.com/UQComputingSociety","followers_url":"https://api.github.com/users/UQComputingSociety/followers","following_url":"https://api.github.com/users/UQComputingSociety/following{/other_user}","gists_url":"https://api.github.com/users/UQComputingSociety/gists{/gist_id}","starred_url":"https://api.github.com/users/UQComputingSociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UQComputingSociety/subscriptions","organizations_url":"https://api.github.com/users/UQComputingSociety/orgs","repos_url":"https://api.github.com/users/UQComputingSociety/repos","events_url":"https://api.github.com/users/UQComputingSociety/events{/privacy}","received_events_url":"https://api.github.com/users/UQComputingSociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UQComputingSociety/uqcsbot","description":"UQCSbot: our friendly little Slack bot","fork":false,"url":"https://api.github.com/repos/UQComputingSociety/uqcsbot","forks_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/forks","keys_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/teams","hooks_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/hooks","issue_events_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/events{/number}","events_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/events","assignees_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/assignees{/user}","branches_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/branches{/branch}","tags_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/tags","blobs_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/statuses/{sha}","languages_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/languages","stargazers_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/stargazers","contributors_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/contributors","subscribers_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/subscribers","subscription_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/subscription","commits_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/contents/{+path}","compare_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/merges","archive_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/downloads","issues_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues{/number}","pulls_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls{/number}","milestones_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/milestones{/number}","notifications_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/labels{/name}","releases_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/releases{/id}","deployments_url":"https://api.github.com/repos/UQComputingSociety/uqcsbot/deployments","created_at":"2015-11-15T08:49:04Z","updated_at":"2018-03-03T08:05:04Z","pushed_at":"2018-03-08T12:56:49Z","git_url":"git://github.com/UQComputingSociety/uqcsbot.git","ssh_url":"git@github.com:UQComputingSociety/uqcsbot.git","clone_url":"https://github.com/UQComputingSociety/uqcsbot.git","svn_url":"https://github.com/UQComputingSociety/uqcsbot","homepage":"https://slack.uqcs.org.au","size":431,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":28,"open_issues":42,"watchers":24,"default_branch":"python-rewrite"}},"_links":{"self":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263"},"html":{"href":"https://github.com/UQComputingSociety/uqcsbot/pull/263"},"issue":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/263"},"comments":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/UQComputingSociety/uqcsbot/statuses/31878a8db3928d7664f4e6bdd720a533e9714c00"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mitchmcdee"}}