{"action":"created","comment":{"url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/comments/22700048","id":22700048,"diff_hunk":"@@ -0,0 +1,59 @@\n+# Description:\n+#   Remind users to give a daily status update\n+#\n+#   You can use package hubot-cron-json to execute the send reminders task\n+#   at a certain time. Update conf/cron-tasks.json to set the time.\n+#\n+# Commands:\n+#   status reminder add user <username> - Add a user\n+#   status reminder remove user <username> - Remove a user\n+#   status reminder list users - List all users getting reminders and show stats\n+#   status reminder send reminders - Send reminders\n+#\n+module.exports = (robot) ->\n+  robot.brain.data.status_reminder ||= {}\n+  robot.brain.data.status_reminder.users ||= []\n+\n+  seconds_since_midnight = ->\n+    d = new Date()\n+    e = new Date(d)\n+    e - d.setHours(0,0,0,0)\n+\n+  send_reminders = ->\n+    for user in robot.brain.data.status_reminder.users\n+      if user.last_status_date < (new Date().getTime()) - milliseconds_since_midnight)\n+        message = \"Hey #{username}! Please update your daily status. Thanks!\"\n+        robot.send {user: {name: user.username}}, message\n+\n+  robot.respond /status reminder add user\\s+(.*)?$/i, (msg) ->\n+    username = msg.match[1]\n+    user =\n+      streak: 0\n+      last_status_date: 0\n+      username: username\n+    robot.brain.data.status_reminder.users.push user\n+    msg.send \"Added user: #{username}\"\n+\n+  robot.respond /status reminder remove user\\s+(.*)?$/i, (msg) ->\n+    username = msg.match[1]\n+    users = robot.brain.data.status_reminder.users\n+    robot.brain.data.status_reminder.users = users.filter (user) ->\n+      user.username != username\n+    msg.send \"Removed user: #{username}\"\n+\n+  robot.respond /status reminder list users/i, (msg) ->\n+    for user in robot.brain.data.status_reminder.users\n+      msg.send \"#{user.username} - Streak: #{user.streak} - Last update: #{new Date(user.last_status_date)}\"\n+\n+  robot.respond /status reminder send reminders/i, ->\n+    send_reminders()\n+\n+  robot.on /status reminder send reminders/i, ->\n+    send_reminders()\n+\n+  robot.hear /^t:|^today:/i, (msg) ->\n+    username = msg.message.user.name","path":"scripts/status_reminder.coffee","position":55,"original_position":55,"commit_id":"67f18407c877e5d547387f9272aef8253aef4a46","original_commit_id":"67f18407c877e5d547387f9272aef8253aef4a46","user":{"login":"nuex","id":6081,"avatar_url":"https://avatars.githubusercontent.com/u/6081?v=3","gravatar_id":"","url":"https://api.github.com/users/nuex","html_url":"https://github.com/nuex","followers_url":"https://api.github.com/users/nuex/followers","following_url":"https://api.github.com/users/nuex/following{/other_user}","gists_url":"https://api.github.com/users/nuex/gists{/gist_id}","starred_url":"https://api.github.com/users/nuex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuex/subscriptions","organizations_url":"https://api.github.com/users/nuex/orgs","repos_url":"https://api.github.com/users/nuex/repos","events_url":"https://api.github.com/users/nuex/events{/privacy}","received_events_url":"https://api.github.com/users/nuex/received_events","type":"User","site_admin":false},"body":"It will be interesting to see if this is bot compatible. I don't want to join #standups.","created_at":"2015-01-09T03:32:19Z","updated_at":"2015-01-09T03:32:19Z","html_url":"https://github.com/moneypenny/cleverhubot/pull/5#discussion_r22700048","pull_request_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/comments/22700048"},"html":{"href":"https://github.com/moneypenny/cleverhubot/pull/5#discussion_r22700048"},"pull_request":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5","id":27072994,"html_url":"https://github.com/moneypenny/cleverhubot/pull/5","diff_url":"https://github.com/moneypenny/cleverhubot/pull/5.diff","patch_url":"https://github.com/moneypenny/cleverhubot/pull/5.patch","issue_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/5","number":5,"state":"open","locked":false,"title":"daily status reminder hubot","user":{"login":"nikolaiwarner","id":40796,"avatar_url":"https://avatars.githubusercontent.com/u/40796?v=3","gravatar_id":"","url":"https://api.github.com/users/nikolaiwarner","html_url":"https://github.com/nikolaiwarner","followers_url":"https://api.github.com/users/nikolaiwarner/followers","following_url":"https://api.github.com/users/nikolaiwarner/following{/other_user}","gists_url":"https://api.github.com/users/nikolaiwarner/gists{/gist_id}","starred_url":"https://api.github.com/users/nikolaiwarner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikolaiwarner/subscriptions","organizations_url":"https://api.github.com/users/nikolaiwarner/orgs","repos_url":"https://api.github.com/users/nikolaiwarner/repos","events_url":"https://api.github.com/users/nikolaiwarner/events{/privacy}","received_events_url":"https://api.github.com/users/nikolaiwarner/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-09T00:54:26Z","updated_at":"2015-01-09T03:32:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"788268f532cf6889756fba8f315b415eb52e324e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5/commits","review_comments_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5/comments","review_comment_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/comments/{number}","comments_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/5/comments","statuses_url":"https://api.github.com/repos/moneypenny/cleverhubot/statuses/67f18407c877e5d547387f9272aef8253aef4a46","head":{"label":"moneypenny:status_reminder","ref":"status_reminder","sha":"67f18407c877e5d547387f9272aef8253aef4a46","user":{"login":"moneypenny","id":82317,"avatar_url":"https://avatars.githubusercontent.com/u/82317?v=3","gravatar_id":"","url":"https://api.github.com/users/moneypenny","html_url":"https://github.com/moneypenny","followers_url":"https://api.github.com/users/moneypenny/followers","following_url":"https://api.github.com/users/moneypenny/following{/other_user}","gists_url":"https://api.github.com/users/moneypenny/gists{/gist_id}","starred_url":"https://api.github.com/users/moneypenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneypenny/subscriptions","organizations_url":"https://api.github.com/users/moneypenny/orgs","repos_url":"https://api.github.com/users/moneypenny/repos","events_url":"https://api.github.com/users/moneypenny/events{/privacy}","received_events_url":"https://api.github.com/users/moneypenny/received_events","type":"User","site_admin":false},"repo":{"id":24440101,"name":"cleverhubot","full_name":"moneypenny/cleverhubot","owner":{"login":"moneypenny","id":82317,"avatar_url":"https://avatars.githubusercontent.com/u/82317?v=3","gravatar_id":"","url":"https://api.github.com/users/moneypenny","html_url":"https://github.com/moneypenny","followers_url":"https://api.github.com/users/moneypenny/followers","following_url":"https://api.github.com/users/moneypenny/following{/other_user}","gists_url":"https://api.github.com/users/moneypenny/gists{/gist_id}","starred_url":"https://api.github.com/users/moneypenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneypenny/subscriptions","organizations_url":"https://api.github.com/users/moneypenny/orgs","repos_url":"https://api.github.com/users/moneypenny/repos","events_url":"https://api.github.com/users/moneypenny/events{/privacy}","received_events_url":"https://api.github.com/users/moneypenny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/moneypenny/cleverhubot","description":"A Hubot for use in Slack. Includes some custom scripts.","fork":false,"url":"https://api.github.com/repos/moneypenny/cleverhubot","forks_url":"https://api.github.com/repos/moneypenny/cleverhubot/forks","keys_url":"https://api.github.com/repos/moneypenny/cleverhubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneypenny/cleverhubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneypenny/cleverhubot/teams","hooks_url":"https://api.github.com/repos/moneypenny/cleverhubot/hooks","issue_events_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/events{/number}","events_url":"https://api.github.com/repos/moneypenny/cleverhubot/events","assignees_url":"https://api.github.com/repos/moneypenny/cleverhubot/assignees{/user}","branches_url":"https://api.github.com/repos/moneypenny/cleverhubot/branches{/branch}","tags_url":"https://api.github.com/repos/moneypenny/cleverhubot/tags","blobs_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneypenny/cleverhubot/statuses/{sha}","languages_url":"https://api.github.com/repos/moneypenny/cleverhubot/languages","stargazers_url":"https://api.github.com/repos/moneypenny/cleverhubot/stargazers","contributors_url":"https://api.github.com/repos/moneypenny/cleverhubot/contributors","subscribers_url":"https://api.github.com/repos/moneypenny/cleverhubot/subscribers","subscription_url":"https://api.github.com/repos/moneypenny/cleverhubot/subscription","commits_url":"https://api.github.com/repos/moneypenny/cleverhubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneypenny/cleverhubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneypenny/cleverhubot/contents/{+path}","compare_url":"https://api.github.com/repos/moneypenny/cleverhubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneypenny/cleverhubot/merges","archive_url":"https://api.github.com/repos/moneypenny/cleverhubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneypenny/cleverhubot/downloads","issues_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues{/number}","pulls_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls{/number}","milestones_url":"https://api.github.com/repos/moneypenny/cleverhubot/milestones{/number}","notifications_url":"https://api.github.com/repos/moneypenny/cleverhubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneypenny/cleverhubot/labels{/name}","releases_url":"https://api.github.com/repos/moneypenny/cleverhubot/releases{/id}","created_at":"2014-09-25T02:11:27Z","updated_at":"2014-12-12T19:29:48Z","pushed_at":"2015-01-09T01:39:33Z","git_url":"git://github.com/moneypenny/cleverhubot.git","ssh_url":"git@github.com:moneypenny/cleverhubot.git","clone_url":"https://github.com/moneypenny/cleverhubot.git","svn_url":"https://github.com/moneypenny/cleverhubot","homepage":"","size":424,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"moneypenny:master","ref":"master","sha":"b4415b8d7e7de03dc5e3b4da64e3c1678a4b439e","user":{"login":"moneypenny","id":82317,"avatar_url":"https://avatars.githubusercontent.com/u/82317?v=3","gravatar_id":"","url":"https://api.github.com/users/moneypenny","html_url":"https://github.com/moneypenny","followers_url":"https://api.github.com/users/moneypenny/followers","following_url":"https://api.github.com/users/moneypenny/following{/other_user}","gists_url":"https://api.github.com/users/moneypenny/gists{/gist_id}","starred_url":"https://api.github.com/users/moneypenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneypenny/subscriptions","organizations_url":"https://api.github.com/users/moneypenny/orgs","repos_url":"https://api.github.com/users/moneypenny/repos","events_url":"https://api.github.com/users/moneypenny/events{/privacy}","received_events_url":"https://api.github.com/users/moneypenny/received_events","type":"User","site_admin":false},"repo":{"id":24440101,"name":"cleverhubot","full_name":"moneypenny/cleverhubot","owner":{"login":"moneypenny","id":82317,"avatar_url":"https://avatars.githubusercontent.com/u/82317?v=3","gravatar_id":"","url":"https://api.github.com/users/moneypenny","html_url":"https://github.com/moneypenny","followers_url":"https://api.github.com/users/moneypenny/followers","following_url":"https://api.github.com/users/moneypenny/following{/other_user}","gists_url":"https://api.github.com/users/moneypenny/gists{/gist_id}","starred_url":"https://api.github.com/users/moneypenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneypenny/subscriptions","organizations_url":"https://api.github.com/users/moneypenny/orgs","repos_url":"https://api.github.com/users/moneypenny/repos","events_url":"https://api.github.com/users/moneypenny/events{/privacy}","received_events_url":"https://api.github.com/users/moneypenny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/moneypenny/cleverhubot","description":"A Hubot for use in Slack. Includes some custom scripts.","fork":false,"url":"https://api.github.com/repos/moneypenny/cleverhubot","forks_url":"https://api.github.com/repos/moneypenny/cleverhubot/forks","keys_url":"https://api.github.com/repos/moneypenny/cleverhubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneypenny/cleverhubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneypenny/cleverhubot/teams","hooks_url":"https://api.github.com/repos/moneypenny/cleverhubot/hooks","issue_events_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/events{/number}","events_url":"https://api.github.com/repos/moneypenny/cleverhubot/events","assignees_url":"https://api.github.com/repos/moneypenny/cleverhubot/assignees{/user}","branches_url":"https://api.github.com/repos/moneypenny/cleverhubot/branches{/branch}","tags_url":"https://api.github.com/repos/moneypenny/cleverhubot/tags","blobs_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneypenny/cleverhubot/statuses/{sha}","languages_url":"https://api.github.com/repos/moneypenny/cleverhubot/languages","stargazers_url":"https://api.github.com/repos/moneypenny/cleverhubot/stargazers","contributors_url":"https://api.github.com/repos/moneypenny/cleverhubot/contributors","subscribers_url":"https://api.github.com/repos/moneypenny/cleverhubot/subscribers","subscription_url":"https://api.github.com/repos/moneypenny/cleverhubot/subscription","commits_url":"https://api.github.com/repos/moneypenny/cleverhubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneypenny/cleverhubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneypenny/cleverhubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneypenny/cleverhubot/contents/{+path}","compare_url":"https://api.github.com/repos/moneypenny/cleverhubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneypenny/cleverhubot/merges","archive_url":"https://api.github.com/repos/moneypenny/cleverhubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneypenny/cleverhubot/downloads","issues_url":"https://api.github.com/repos/moneypenny/cleverhubot/issues{/number}","pulls_url":"https://api.github.com/repos/moneypenny/cleverhubot/pulls{/number}","milestones_url":"https://api.github.com/repos/moneypenny/cleverhubot/milestones{/number}","notifications_url":"https://api.github.com/repos/moneypenny/cleverhubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneypenny/cleverhubot/labels{/name}","releases_url":"https://api.github.com/repos/moneypenny/cleverhubot/releases{/id}","created_at":"2014-09-25T02:11:27Z","updated_at":"2014-12-12T19:29:48Z","pushed_at":"2015-01-09T01:39:33Z","git_url":"git://github.com/moneypenny/cleverhubot.git","ssh_url":"git@github.com:moneypenny/cleverhubot.git","clone_url":"https://github.com/moneypenny/cleverhubot.git","svn_url":"https://github.com/moneypenny/cleverhubot","homepage":"","size":424,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5"},"html":{"href":"https://github.com/moneypenny/cleverhubot/pull/5"},"issue":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/issues/5"},"comments":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/moneypenny/cleverhubot/statuses/67f18407c877e5d547387f9272aef8253aef4a46"}}}}