{"action":"created","comment":{"url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/comments/52418943","id":52418943,"diff_hunk":"@@ -395,3 +395,64 @@ def get(self, request, uuid, path):\n             tb = traceback.format_exc()\n             log_exception(self, e, tb)\n             return Response({\"error\": smart_str(e)}, status=500)\n+\n+class ChatBoxApi(views.APIView):\n+\n+    \"\"\"\n+    Return all the chats that the user has had before\n+    \"\"\"\n+    def get(self, request):\n+        service = BundleService(self.request.user)\n+        try:\n+            user_id = request.GET.get('user_id', None)\n+            info = {\n+                'user_id': self.request.user.id if user_id == None else user_id\n+            }\n+            chats = service.get_chat_log_info(info)            \n+            return Response({'chats': chats}, content_type=\"application/json\")\n+        except Exception as e:\n+            tb = traceback.format_exc()\n+            log_exception(self, e, tb)\n+            return Response({\"error\": smart_str(e)}, status=500)\n+\n+    \"\"\"\n+    Add the chat to the log. Return the updated chat log\n+    \"\"\"\n+    def post(self, request):\n+        service = BundleService(self.request.user)\n+        try:\n+            recipient_user_id = request.POST.get('recipientUserId', None)\n+            message = request.POST.get('message', None)\n+            worksheet_uuid = request.POST.get('worksheetId', -1)\n+            bundle_uuid = request.POST.get('bundleId', -1)\n+            sender_user_id = request.POST.get('senderUserId', None)\n+            info = {\n+                'sender_user_id': self.request.user.id if sender_user_id == None else sender_user_id,\n+                'recipient_user_id': recipient_user_id,\n+                'message': message,\n+                'worksheet_uuid': worksheet_uuid,\n+                'bundle_uuid': bundle_uuid,\n+            }\n+            chats = service.add_chat_log_info(info)\n+            return Response({'chats': chats}, content_type=\"application/json\")\n+        except Exception as e:\n+            tb = traceback.format_exc()\n+            log_exception(self, e, tb)\n+            return Response({\"error\": smart_str(e)}, status=500)\n+\n+class UsersApi(views.APIView):\n+    def get(self, request):\n+        service = BundleService(self.request.user)\n+        try:\n+            user_info = service.get_user_info(None)\n+            return Response({'user_info': user_info}, content_type=\"application/json\")\n+        except Exception as e:\n+            tb = traceback.format_exc()\n+            log_exception(self, e, tb)\n+            return Response({\"error\": smart_str(e)}, status=500)\n+\n+        ","path":"codalab/apps/api/views/worksheet_views.py","position":60,"original_position":60,"commit_id":"0695903d8ab01ab6575c5a6c4c266bd70c22f09d","original_commit_id":"0695903d8ab01ab6575c5a6c4c266bd70c22f09d","user":{"login":"percyliang","id":435384,"avatar_url":"https://avatars.githubusercontent.com/u/435384?v=3","gravatar_id":"","url":"https://api.github.com/users/percyliang","html_url":"https://github.com/percyliang","followers_url":"https://api.github.com/users/percyliang/followers","following_url":"https://api.github.com/users/percyliang/following{/other_user}","gists_url":"https://api.github.com/users/percyliang/gists{/gist_id}","starred_url":"https://api.github.com/users/percyliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percyliang/subscriptions","organizations_url":"https://api.github.com/users/percyliang/orgs","repos_url":"https://api.github.com/users/percyliang/repos","events_url":"https://api.github.com/users/percyliang/events{/privacy}","received_events_url":"https://api.github.com/users/percyliang/received_events","type":"User","site_admin":false},"body":"remove extra newlines","created_at":"2016-02-10T06:19:01Z","updated_at":"2016-02-10T06:19:01Z","html_url":"https://github.com/codalab/codalab-worksheets/pull/66#discussion_r52418943","pull_request_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/comments/52418943"},"html":{"href":"https://github.com/codalab/codalab-worksheets/pull/66#discussion_r52418943"},"pull_request":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66","id":55837139,"html_url":"https://github.com/codalab/codalab-worksheets/pull/66","diff_url":"https://github.com/codalab/codalab-worksheets/pull/66.diff","patch_url":"https://github.com/codalab/codalab-worksheets/pull/66.patch","issue_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/66","number":66,"state":"open","locked":false,"title":"issue #63, created basic help bar (used a chat box library, not pixel perfect yet)","user":{"login":"ChengshuLi","id":6732996,"avatar_url":"https://avatars.githubusercontent.com/u/6732996?v=3","gravatar_id":"","url":"https://api.github.com/users/ChengshuLi","html_url":"https://github.com/ChengshuLi","followers_url":"https://api.github.com/users/ChengshuLi/followers","following_url":"https://api.github.com/users/ChengshuLi/following{/other_user}","gists_url":"https://api.github.com/users/ChengshuLi/gists{/gist_id}","starred_url":"https://api.github.com/users/ChengshuLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChengshuLi/subscriptions","organizations_url":"https://api.github.com/users/ChengshuLi/orgs","repos_url":"https://api.github.com/users/ChengshuLi/repos","events_url":"https://api.github.com/users/ChengshuLi/events{/privacy}","received_events_url":"https://api.github.com/users/ChengshuLi/received_events","type":"User","site_admin":false},"body":"To-do: NLP ","created_at":"2016-01-13T00:09:30Z","updated_at":"2016-02-10T06:19:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3d25518f0d1790375078cf8b914113d6d67c60b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66/commits","review_comments_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66/comments","review_comment_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/66/comments","statuses_url":"https://api.github.com/repos/codalab/codalab-worksheets/statuses/0695903d8ab01ab6575c5a6c4c266bd70c22f09d","head":{"label":"codalab:63","ref":"63","sha":"0695903d8ab01ab6575c5a6c4c266bd70c22f09d","user":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"repo":{"id":48640313,"name":"codalab-worksheets","full_name":"codalab/codalab-worksheets","owner":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codalab/codalab-worksheets","description":"CodaLab Worksheets","fork":false,"url":"https://api.github.com/repos/codalab/codalab-worksheets","forks_url":"https://api.github.com/repos/codalab/codalab-worksheets/forks","keys_url":"https://api.github.com/repos/codalab/codalab-worksheets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codalab/codalab-worksheets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codalab/codalab-worksheets/teams","hooks_url":"https://api.github.com/repos/codalab/codalab-worksheets/hooks","issue_events_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/events{/number}","events_url":"https://api.github.com/repos/codalab/codalab-worksheets/events","assignees_url":"https://api.github.com/repos/codalab/codalab-worksheets/assignees{/user}","branches_url":"https://api.github.com/repos/codalab/codalab-worksheets/branches{/branch}","tags_url":"https://api.github.com/repos/codalab/codalab-worksheets/tags","blobs_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/refs{/sha}","trees_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codalab/codalab-worksheets/statuses/{sha}","languages_url":"https://api.github.com/repos/codalab/codalab-worksheets/languages","stargazers_url":"https://api.github.com/repos/codalab/codalab-worksheets/stargazers","contributors_url":"https://api.github.com/repos/codalab/codalab-worksheets/contributors","subscribers_url":"https://api.github.com/repos/codalab/codalab-worksheets/subscribers","subscription_url":"https://api.github.com/repos/codalab/codalab-worksheets/subscription","commits_url":"https://api.github.com/repos/codalab/codalab-worksheets/commits{/sha}","git_commits_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/commits{/sha}","comments_url":"https://api.github.com/repos/codalab/codalab-worksheets/comments{/number}","issue_comment_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/comments{/number}","contents_url":"https://api.github.com/repos/codalab/codalab-worksheets/contents/{+path}","compare_url":"https://api.github.com/repos/codalab/codalab-worksheets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codalab/codalab-worksheets/merges","archive_url":"https://api.github.com/repos/codalab/codalab-worksheets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codalab/codalab-worksheets/downloads","issues_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues{/number}","pulls_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls{/number}","milestones_url":"https://api.github.com/repos/codalab/codalab-worksheets/milestones{/number}","notifications_url":"https://api.github.com/repos/codalab/codalab-worksheets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codalab/codalab-worksheets/labels{/name}","releases_url":"https://api.github.com/repos/codalab/codalab-worksheets/releases{/id}","deployments_url":"https://api.github.com/repos/codalab/codalab-worksheets/deployments","created_at":"2015-12-27T09:51:16Z","updated_at":"2016-01-19T21:16:59Z","pushed_at":"2016-02-09T20:05:50Z","git_url":"git://github.com/codalab/codalab-worksheets.git","ssh_url":"git@github.com:codalab/codalab-worksheets.git","clone_url":"https://github.com/codalab/codalab-worksheets.git","svn_url":"https://github.com/codalab/codalab-worksheets","homepage":null,"size":24857,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":51,"forks":3,"open_issues":51,"watchers":3,"default_branch":"master"}},"base":{"label":"codalab:develop","ref":"develop","sha":"50716e6b90aaa1ec24c5b15cfbbdd11c2ab78573","user":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"repo":{"id":48640313,"name":"codalab-worksheets","full_name":"codalab/codalab-worksheets","owner":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codalab/codalab-worksheets","description":"CodaLab Worksheets","fork":false,"url":"https://api.github.com/repos/codalab/codalab-worksheets","forks_url":"https://api.github.com/repos/codalab/codalab-worksheets/forks","keys_url":"https://api.github.com/repos/codalab/codalab-worksheets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codalab/codalab-worksheets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codalab/codalab-worksheets/teams","hooks_url":"https://api.github.com/repos/codalab/codalab-worksheets/hooks","issue_events_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/events{/number}","events_url":"https://api.github.com/repos/codalab/codalab-worksheets/events","assignees_url":"https://api.github.com/repos/codalab/codalab-worksheets/assignees{/user}","branches_url":"https://api.github.com/repos/codalab/codalab-worksheets/branches{/branch}","tags_url":"https://api.github.com/repos/codalab/codalab-worksheets/tags","blobs_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/refs{/sha}","trees_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codalab/codalab-worksheets/statuses/{sha}","languages_url":"https://api.github.com/repos/codalab/codalab-worksheets/languages","stargazers_url":"https://api.github.com/repos/codalab/codalab-worksheets/stargazers","contributors_url":"https://api.github.com/repos/codalab/codalab-worksheets/contributors","subscribers_url":"https://api.github.com/repos/codalab/codalab-worksheets/subscribers","subscription_url":"https://api.github.com/repos/codalab/codalab-worksheets/subscription","commits_url":"https://api.github.com/repos/codalab/codalab-worksheets/commits{/sha}","git_commits_url":"https://api.github.com/repos/codalab/codalab-worksheets/git/commits{/sha}","comments_url":"https://api.github.com/repos/codalab/codalab-worksheets/comments{/number}","issue_comment_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues/comments{/number}","contents_url":"https://api.github.com/repos/codalab/codalab-worksheets/contents/{+path}","compare_url":"https://api.github.com/repos/codalab/codalab-worksheets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codalab/codalab-worksheets/merges","archive_url":"https://api.github.com/repos/codalab/codalab-worksheets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codalab/codalab-worksheets/downloads","issues_url":"https://api.github.com/repos/codalab/codalab-worksheets/issues{/number}","pulls_url":"https://api.github.com/repos/codalab/codalab-worksheets/pulls{/number}","milestones_url":"https://api.github.com/repos/codalab/codalab-worksheets/milestones{/number}","notifications_url":"https://api.github.com/repos/codalab/codalab-worksheets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codalab/codalab-worksheets/labels{/name}","releases_url":"https://api.github.com/repos/codalab/codalab-worksheets/releases{/id}","deployments_url":"https://api.github.com/repos/codalab/codalab-worksheets/deployments","created_at":"2015-12-27T09:51:16Z","updated_at":"2016-01-19T21:16:59Z","pushed_at":"2016-02-09T20:05:50Z","git_url":"git://github.com/codalab/codalab-worksheets.git","ssh_url":"git@github.com:codalab/codalab-worksheets.git","clone_url":"https://github.com/codalab/codalab-worksheets.git","svn_url":"https://github.com/codalab/codalab-worksheets","homepage":null,"size":24857,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":51,"forks":3,"open_issues":51,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66"},"html":{"href":"https://github.com/codalab/codalab-worksheets/pull/66"},"issue":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/issues/66"},"comments":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/codalab/codalab-worksheets/statuses/0695903d8ab01ab6575c5a6c4c266bd70c22f09d"}}}}