{"action":"created","comment":{"url":"https://api.github.com/repos/jmduke/corji/pulls/comments/49942308","id":49942308,"diff_hunk":"@@ -0,0 +1,85 @@\n+import json\n+import logging\n+import random\n+\n+from flask import (\n+    Blueprint,\n+    render_template,\n+    request\n+)\n+\n+from corji.api import CorgiResource\n+import corji.data_sources.google_spreadsheets as google_spreadsheets\n+from corji.logging import logged_view\n+import corji.settings as settings\n+from corji.utils.emoji import (\n+    text_contains_emoji,\n+    emojis_for_emoticons,\n+    emoji_contains_skin_tone,\n+    emoji_is_numeric\n+)\n+\n+slack_blueprint = Blueprint('slack', __name__,\n+                            template_folder='templates')\n+\n+api = CorgiResource()\n+\n+logger = logging.getLogger(settings.Config.LOGGER_NAME)\n+\n+\n+def generate_slack_failure_case_message(text, image_url=\"\"):\n+    message = {}\n+    message['text'] = text\n+    if image_url:\n+        attachment = {}\n+        attachment = {'image_url': image_url}\n+        attachment_array = [attachment]\n+        message['attachments'] = attachment_array\n+    return json.dumps(message)\n+\n+\n+def generate_slack_corgi_case(corgi_url):\n+    message = {}\n+    message['response_type'] = \"in_channel\"\n+    message['text'] = \"\"\n+    attachment = {}\n+    attachment = {'image_url': corgi_url}\n+    attachment_array = [attachment]\n+    message['attachments'] = attachment_array\n+    return json.dumps(message)\n+\n+\n+@slack_blueprint.route(\"/slack\", methods=['GET', 'POST'])\n+@logged_view(logger)\n+def slack_corgi():\n+    from_name = request.values.get(\"user_name\") or \"\"","path":"corji/views/slack.py","position":55,"original_position":55,"commit_id":"389d9ebb5a63a208e4b2ef1bb0fed3b8f639ecd5","original_commit_id":"389d9ebb5a63a208e4b2ef1bb0fed3b8f639ecd5","user":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"body":"I believe this can be rewritten as `request.values.get('username', '')` (same with the lines below)","created_at":"2016-01-17T06:46:32Z","updated_at":"2016-01-17T06:46:32Z","html_url":"https://github.com/jmduke/corji/pull/103#discussion_r49942308","pull_request_url":"https://api.github.com/repos/jmduke/corji/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/jmduke/corji/pulls/comments/49942308"},"html":{"href":"https://github.com/jmduke/corji/pull/103#discussion_r49942308"},"pull_request":{"href":"https://api.github.com/repos/jmduke/corji/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/jmduke/corji/pulls/103","id":56271698,"html_url":"https://github.com/jmduke/corji/pull/103","diff_url":"https://github.com/jmduke/corji/pull/103.diff","patch_url":"https://github.com/jmduke/corji/pull/103.patch","issue_url":"https://api.github.com/repos/jmduke/corji/issues/103","number":103,"state":"open","locked":false,"title":"Initial slack \"command\" support","user":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-17T06:41:54Z","updated_at":"2016-01-17T06:46:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79c3ac37da5308dd0a09cb2eb410d90c80963fd7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jmduke/corji/pulls/103/commits","review_comments_url":"https://api.github.com/repos/jmduke/corji/pulls/103/comments","review_comment_url":"https://api.github.com/repos/jmduke/corji/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jmduke/corji/issues/103/comments","statuses_url":"https://api.github.com/repos/jmduke/corji/statuses/389d9ebb5a63a208e4b2ef1bb0fed3b8f639ecd5","head":{"label":"shepwalker:master","ref":"master","sha":"389d9ebb5a63a208e4b2ef1bb0fed3b8f639ecd5","user":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"repo":{"id":42966628,"name":"corji","full_name":"shepwalker/corji","owner":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shepwalker/corji","description":"corji.","fork":true,"url":"https://api.github.com/repos/shepwalker/corji","forks_url":"https://api.github.com/repos/shepwalker/corji/forks","keys_url":"https://api.github.com/repos/shepwalker/corji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shepwalker/corji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shepwalker/corji/teams","hooks_url":"https://api.github.com/repos/shepwalker/corji/hooks","issue_events_url":"https://api.github.com/repos/shepwalker/corji/issues/events{/number}","events_url":"https://api.github.com/repos/shepwalker/corji/events","assignees_url":"https://api.github.com/repos/shepwalker/corji/assignees{/user}","branches_url":"https://api.github.com/repos/shepwalker/corji/branches{/branch}","tags_url":"https://api.github.com/repos/shepwalker/corji/tags","blobs_url":"https://api.github.com/repos/shepwalker/corji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shepwalker/corji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shepwalker/corji/git/refs{/sha}","trees_url":"https://api.github.com/repos/shepwalker/corji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shepwalker/corji/statuses/{sha}","languages_url":"https://api.github.com/repos/shepwalker/corji/languages","stargazers_url":"https://api.github.com/repos/shepwalker/corji/stargazers","contributors_url":"https://api.github.com/repos/shepwalker/corji/contributors","subscribers_url":"https://api.github.com/repos/shepwalker/corji/subscribers","subscription_url":"https://api.github.com/repos/shepwalker/corji/subscription","commits_url":"https://api.github.com/repos/shepwalker/corji/commits{/sha}","git_commits_url":"https://api.github.com/repos/shepwalker/corji/git/commits{/sha}","comments_url":"https://api.github.com/repos/shepwalker/corji/comments{/number}","issue_comment_url":"https://api.github.com/repos/shepwalker/corji/issues/comments{/number}","contents_url":"https://api.github.com/repos/shepwalker/corji/contents/{+path}","compare_url":"https://api.github.com/repos/shepwalker/corji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shepwalker/corji/merges","archive_url":"https://api.github.com/repos/shepwalker/corji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shepwalker/corji/downloads","issues_url":"https://api.github.com/repos/shepwalker/corji/issues{/number}","pulls_url":"https://api.github.com/repos/shepwalker/corji/pulls{/number}","milestones_url":"https://api.github.com/repos/shepwalker/corji/milestones{/number}","notifications_url":"https://api.github.com/repos/shepwalker/corji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shepwalker/corji/labels{/name}","releases_url":"https://api.github.com/repos/shepwalker/corji/releases{/id}","created_at":"2015-09-22T23:25:06Z","updated_at":"2016-01-17T06:40:51Z","pushed_at":"2016-01-17T06:40:50Z","git_url":"git://github.com/shepwalker/corji.git","ssh_url":"git@github.com:shepwalker/corji.git","clone_url":"https://github.com/shepwalker/corji.git","svn_url":"https://github.com/shepwalker/corji","homepage":null,"size":1471,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":"jmduke:master","ref":"master","sha":"cf1e8ea744fc386559257ccc96fbe1f465391982","user":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"repo":{"id":42948556,"name":"corji","full_name":"jmduke/corji","owner":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmduke/corji","description":"A distributed*, resilient*, high-availability* CDN (Corgi Delivery Network) using SMS as a transport layer.","fork":false,"url":"https://api.github.com/repos/jmduke/corji","forks_url":"https://api.github.com/repos/jmduke/corji/forks","keys_url":"https://api.github.com/repos/jmduke/corji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmduke/corji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmduke/corji/teams","hooks_url":"https://api.github.com/repos/jmduke/corji/hooks","issue_events_url":"https://api.github.com/repos/jmduke/corji/issues/events{/number}","events_url":"https://api.github.com/repos/jmduke/corji/events","assignees_url":"https://api.github.com/repos/jmduke/corji/assignees{/user}","branches_url":"https://api.github.com/repos/jmduke/corji/branches{/branch}","tags_url":"https://api.github.com/repos/jmduke/corji/tags","blobs_url":"https://api.github.com/repos/jmduke/corji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmduke/corji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmduke/corji/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmduke/corji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmduke/corji/statuses/{sha}","languages_url":"https://api.github.com/repos/jmduke/corji/languages","stargazers_url":"https://api.github.com/repos/jmduke/corji/stargazers","contributors_url":"https://api.github.com/repos/jmduke/corji/contributors","subscribers_url":"https://api.github.com/repos/jmduke/corji/subscribers","subscription_url":"https://api.github.com/repos/jmduke/corji/subscription","commits_url":"https://api.github.com/repos/jmduke/corji/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmduke/corji/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmduke/corji/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmduke/corji/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmduke/corji/contents/{+path}","compare_url":"https://api.github.com/repos/jmduke/corji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmduke/corji/merges","archive_url":"https://api.github.com/repos/jmduke/corji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmduke/corji/downloads","issues_url":"https://api.github.com/repos/jmduke/corji/issues{/number}","pulls_url":"https://api.github.com/repos/jmduke/corji/pulls{/number}","milestones_url":"https://api.github.com/repos/jmduke/corji/milestones{/number}","notifications_url":"https://api.github.com/repos/jmduke/corji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmduke/corji/labels{/name}","releases_url":"https://api.github.com/repos/jmduke/corji/releases{/id}","created_at":"2015-09-22T17:11:52Z","updated_at":"2015-11-09T16:59:51Z","pushed_at":"2016-01-17T06:41:54Z","git_url":"git://github.com/jmduke/corji.git","ssh_url":"git@github.com:jmduke/corji.git","clone_url":"https://github.com/jmduke/corji.git","svn_url":"https://github.com/jmduke/corji","homepage":"http://corji.club","size":1479,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":22,"forks":2,"open_issues":22,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jmduke/corji/pulls/103"},"html":{"href":"https://github.com/jmduke/corji/pull/103"},"issue":{"href":"https://api.github.com/repos/jmduke/corji/issues/103"},"comments":{"href":"https://api.github.com/repos/jmduke/corji/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/jmduke/corji/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/jmduke/corji/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jmduke/corji/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/jmduke/corji/statuses/389d9ebb5a63a208e4b2ef1bb0fed3b8f639ecd5"}}}}