{"action":"created","comment":{"url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/comments/117096980","pull_request_review_id":38773907,"id":117096980,"diff_hunk":"@@ -4,13 +4,46 @@ const bodyParser = require('body-parser')\n const dbFunctions = require('./db.js')\n const levelup = require('levelup')\n const db = levelup('./hint-hint')\n+const moment = require('moment')\n+const schedule = require('node-schedule')\n+const twilio = require('twilio')\n+const dotenv = require('dotenv').config()\n+const client = new twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN)\n const app = express()\n \n app.use(bodyParser.json())\n \n const publicPath = path.join(__dirname, '/public')\n app.use(express.static(publicPath))\n \n+schedule.scheduleJob('*/10 * * * *', () => {\n+  const now = Date.now()\n+  const promises = []\n+  dbFunctions.getCollection(db, 'events')\n+    .then((data) => {\n+      for (let i = 0; i < data.length; i++) {\n+        let event = data[i]\n+        const time = moment(event.date).format('hh:mm a')\n+        if (Math.abs(now - event.date) <= 3600000 && (now - event.date) < 0 && event.notified !== true) {","path":"server/index.js","position":24,"original_position":24,"commit_id":"06a28bf2f9a9682bd9a9e60ee10675e086e90a22","original_commit_id":"06a28bf2f9a9682bd9a9e60ee10675e086e90a22","user":{"login":"victormejia","id":2253132,"avatar_url":"https://avatars2.githubusercontent.com/u/2253132?v=3","gravatar_id":"","url":"https://api.github.com/users/victormejia","html_url":"https://github.com/victormejia","followers_url":"https://api.github.com/users/victormejia/followers","following_url":"https://api.github.com/users/victormejia/following{/other_user}","gists_url":"https://api.github.com/users/victormejia/gists{/gist_id}","starred_url":"https://api.github.com/users/victormejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victormejia/subscriptions","organizations_url":"https://api.github.com/users/victormejia/orgs","repos_url":"https://api.github.com/users/victormejia/repos","events_url":"https://api.github.com/users/victormejia/events{/privacy}","received_events_url":"https://api.github.com/users/victormejia/received_events","type":"User","site_admin":false},"body":"any reason why we check `(now - event.data) < 0`?","created_at":"2017-05-17T20:04:07Z","updated_at":"2017-05-17T20:04:07Z","html_url":"https://github.com/kirawiley/hint-hint/pull/6#discussion_r117096980","pull_request_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/comments/117096980"},"html":{"href":"https://github.com/kirawiley/hint-hint/pull/6#discussion_r117096980"},"pull_request":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6","id":120916960,"html_url":"https://github.com/kirawiley/hint-hint/pull/6","diff_url":"https://github.com/kirawiley/hint-hint/pull/6.diff","patch_url":"https://github.com/kirawiley/hint-hint/pull/6.patch","issue_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/6","number":6,"state":"open","locked":false,"title":"User can receive a text reminder.","user":{"login":"kirawiley","id":26068989,"avatar_url":"https://avatars3.githubusercontent.com/u/26068989?v=3","gravatar_id":"","url":"https://api.github.com/users/kirawiley","html_url":"https://github.com/kirawiley","followers_url":"https://api.github.com/users/kirawiley/followers","following_url":"https://api.github.com/users/kirawiley/following{/other_user}","gists_url":"https://api.github.com/users/kirawiley/gists{/gist_id}","starred_url":"https://api.github.com/users/kirawiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirawiley/subscriptions","organizations_url":"https://api.github.com/users/kirawiley/orgs","repos_url":"https://api.github.com/users/kirawiley/repos","events_url":"https://api.github.com/users/kirawiley/events{/privacy}","received_events_url":"https://api.github.com/users/kirawiley/received_events","type":"User","site_admin":false},"body":"![img_6066](https://cloud.githubusercontent.com/assets/26068989/26126476/94101156-3a3a-11e7-8178-3a9bb8684bb8.PNG)\r\n","created_at":"2017-05-16T20:21:50Z","updated_at":"2017-05-17T20:04:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1ee3e06d4c944d5a6455a3c49963d929ad245e1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6/commits","review_comments_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6/comments","review_comment_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/6/comments","statuses_url":"https://api.github.com/repos/kirawiley/hint-hint/statuses/06a28bf2f9a9682bd9a9e60ee10675e086e90a22","head":{"label":"kirawiley:reminder-issue-3","ref":"reminder-issue-3","sha":"06a28bf2f9a9682bd9a9e60ee10675e086e90a22","user":{"login":"kirawiley","id":26068989,"avatar_url":"https://avatars3.githubusercontent.com/u/26068989?v=3","gravatar_id":"","url":"https://api.github.com/users/kirawiley","html_url":"https://github.com/kirawiley","followers_url":"https://api.github.com/users/kirawiley/followers","following_url":"https://api.github.com/users/kirawiley/following{/other_user}","gists_url":"https://api.github.com/users/kirawiley/gists{/gist_id}","starred_url":"https://api.github.com/users/kirawiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirawiley/subscriptions","organizations_url":"https://api.github.com/users/kirawiley/orgs","repos_url":"https://api.github.com/users/kirawiley/repos","events_url":"https://api.github.com/users/kirawiley/events{/privacy}","received_events_url":"https://api.github.com/users/kirawiley/received_events","type":"User","site_admin":false},"repo":{"id":90651192,"name":"hint-hint","full_name":"kirawiley/hint-hint","owner":{"login":"kirawiley","id":26068989,"avatar_url":"https://avatars3.githubusercontent.com/u/26068989?v=3","gravatar_id":"","url":"https://api.github.com/users/kirawiley","html_url":"https://github.com/kirawiley","followers_url":"https://api.github.com/users/kirawiley/followers","following_url":"https://api.github.com/users/kirawiley/following{/other_user}","gists_url":"https://api.github.com/users/kirawiley/gists{/gist_id}","starred_url":"https://api.github.com/users/kirawiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirawiley/subscriptions","organizations_url":"https://api.github.com/users/kirawiley/orgs","repos_url":"https://api.github.com/users/kirawiley/repos","events_url":"https://api.github.com/users/kirawiley/events{/privacy}","received_events_url":"https://api.github.com/users/kirawiley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kirawiley/hint-hint","description":"A website for forgetful people to log their upcoming events and receive text message reminders.","fork":false,"url":"https://api.github.com/repos/kirawiley/hint-hint","forks_url":"https://api.github.com/repos/kirawiley/hint-hint/forks","keys_url":"https://api.github.com/repos/kirawiley/hint-hint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kirawiley/hint-hint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kirawiley/hint-hint/teams","hooks_url":"https://api.github.com/repos/kirawiley/hint-hint/hooks","issue_events_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/events{/number}","events_url":"https://api.github.com/repos/kirawiley/hint-hint/events","assignees_url":"https://api.github.com/repos/kirawiley/hint-hint/assignees{/user}","branches_url":"https://api.github.com/repos/kirawiley/hint-hint/branches{/branch}","tags_url":"https://api.github.com/repos/kirawiley/hint-hint/tags","blobs_url":"https://api.github.com/repos/kirawiley/hint-hint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kirawiley/hint-hint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kirawiley/hint-hint/git/refs{/sha}","trees_url":"https://api.github.com/repos/kirawiley/hint-hint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kirawiley/hint-hint/statuses/{sha}","languages_url":"https://api.github.com/repos/kirawiley/hint-hint/languages","stargazers_url":"https://api.github.com/repos/kirawiley/hint-hint/stargazers","contributors_url":"https://api.github.com/repos/kirawiley/hint-hint/contributors","subscribers_url":"https://api.github.com/repos/kirawiley/hint-hint/subscribers","subscription_url":"https://api.github.com/repos/kirawiley/hint-hint/subscription","commits_url":"https://api.github.com/repos/kirawiley/hint-hint/commits{/sha}","git_commits_url":"https://api.github.com/repos/kirawiley/hint-hint/git/commits{/sha}","comments_url":"https://api.github.com/repos/kirawiley/hint-hint/comments{/number}","issue_comment_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/comments{/number}","contents_url":"https://api.github.com/repos/kirawiley/hint-hint/contents/{+path}","compare_url":"https://api.github.com/repos/kirawiley/hint-hint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kirawiley/hint-hint/merges","archive_url":"https://api.github.com/repos/kirawiley/hint-hint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kirawiley/hint-hint/downloads","issues_url":"https://api.github.com/repos/kirawiley/hint-hint/issues{/number}","pulls_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls{/number}","milestones_url":"https://api.github.com/repos/kirawiley/hint-hint/milestones{/number}","notifications_url":"https://api.github.com/repos/kirawiley/hint-hint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kirawiley/hint-hint/labels{/name}","releases_url":"https://api.github.com/repos/kirawiley/hint-hint/releases{/id}","deployments_url":"https://api.github.com/repos/kirawiley/hint-hint/deployments","created_at":"2017-05-08T16:47:20Z","updated_at":"2017-05-10T23:30:36Z","pushed_at":"2017-05-17T20:02:14Z","git_url":"git://github.com/kirawiley/hint-hint.git","ssh_url":"git@github.com:kirawiley/hint-hint.git","clone_url":"https://github.com/kirawiley/hint-hint.git","svn_url":"https://github.com/kirawiley/hint-hint","homepage":null,"size":36,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"kirawiley:master","ref":"master","sha":"3b777260be97a33d69604a90c1b123cdffa6eab6","user":{"login":"kirawiley","id":26068989,"avatar_url":"https://avatars3.githubusercontent.com/u/26068989?v=3","gravatar_id":"","url":"https://api.github.com/users/kirawiley","html_url":"https://github.com/kirawiley","followers_url":"https://api.github.com/users/kirawiley/followers","following_url":"https://api.github.com/users/kirawiley/following{/other_user}","gists_url":"https://api.github.com/users/kirawiley/gists{/gist_id}","starred_url":"https://api.github.com/users/kirawiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirawiley/subscriptions","organizations_url":"https://api.github.com/users/kirawiley/orgs","repos_url":"https://api.github.com/users/kirawiley/repos","events_url":"https://api.github.com/users/kirawiley/events{/privacy}","received_events_url":"https://api.github.com/users/kirawiley/received_events","type":"User","site_admin":false},"repo":{"id":90651192,"name":"hint-hint","full_name":"kirawiley/hint-hint","owner":{"login":"kirawiley","id":26068989,"avatar_url":"https://avatars3.githubusercontent.com/u/26068989?v=3","gravatar_id":"","url":"https://api.github.com/users/kirawiley","html_url":"https://github.com/kirawiley","followers_url":"https://api.github.com/users/kirawiley/followers","following_url":"https://api.github.com/users/kirawiley/following{/other_user}","gists_url":"https://api.github.com/users/kirawiley/gists{/gist_id}","starred_url":"https://api.github.com/users/kirawiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirawiley/subscriptions","organizations_url":"https://api.github.com/users/kirawiley/orgs","repos_url":"https://api.github.com/users/kirawiley/repos","events_url":"https://api.github.com/users/kirawiley/events{/privacy}","received_events_url":"https://api.github.com/users/kirawiley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kirawiley/hint-hint","description":"A website for forgetful people to log their upcoming events and receive text message reminders.","fork":false,"url":"https://api.github.com/repos/kirawiley/hint-hint","forks_url":"https://api.github.com/repos/kirawiley/hint-hint/forks","keys_url":"https://api.github.com/repos/kirawiley/hint-hint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kirawiley/hint-hint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kirawiley/hint-hint/teams","hooks_url":"https://api.github.com/repos/kirawiley/hint-hint/hooks","issue_events_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/events{/number}","events_url":"https://api.github.com/repos/kirawiley/hint-hint/events","assignees_url":"https://api.github.com/repos/kirawiley/hint-hint/assignees{/user}","branches_url":"https://api.github.com/repos/kirawiley/hint-hint/branches{/branch}","tags_url":"https://api.github.com/repos/kirawiley/hint-hint/tags","blobs_url":"https://api.github.com/repos/kirawiley/hint-hint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kirawiley/hint-hint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kirawiley/hint-hint/git/refs{/sha}","trees_url":"https://api.github.com/repos/kirawiley/hint-hint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kirawiley/hint-hint/statuses/{sha}","languages_url":"https://api.github.com/repos/kirawiley/hint-hint/languages","stargazers_url":"https://api.github.com/repos/kirawiley/hint-hint/stargazers","contributors_url":"https://api.github.com/repos/kirawiley/hint-hint/contributors","subscribers_url":"https://api.github.com/repos/kirawiley/hint-hint/subscribers","subscription_url":"https://api.github.com/repos/kirawiley/hint-hint/subscription","commits_url":"https://api.github.com/repos/kirawiley/hint-hint/commits{/sha}","git_commits_url":"https://api.github.com/repos/kirawiley/hint-hint/git/commits{/sha}","comments_url":"https://api.github.com/repos/kirawiley/hint-hint/comments{/number}","issue_comment_url":"https://api.github.com/repos/kirawiley/hint-hint/issues/comments{/number}","contents_url":"https://api.github.com/repos/kirawiley/hint-hint/contents/{+path}","compare_url":"https://api.github.com/repos/kirawiley/hint-hint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kirawiley/hint-hint/merges","archive_url":"https://api.github.com/repos/kirawiley/hint-hint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kirawiley/hint-hint/downloads","issues_url":"https://api.github.com/repos/kirawiley/hint-hint/issues{/number}","pulls_url":"https://api.github.com/repos/kirawiley/hint-hint/pulls{/number}","milestones_url":"https://api.github.com/repos/kirawiley/hint-hint/milestones{/number}","notifications_url":"https://api.github.com/repos/kirawiley/hint-hint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kirawiley/hint-hint/labels{/name}","releases_url":"https://api.github.com/repos/kirawiley/hint-hint/releases{/id}","deployments_url":"https://api.github.com/repos/kirawiley/hint-hint/deployments","created_at":"2017-05-08T16:47:20Z","updated_at":"2017-05-10T23:30:36Z","pushed_at":"2017-05-17T20:02:14Z","git_url":"git://github.com/kirawiley/hint-hint.git","ssh_url":"git@github.com:kirawiley/hint-hint.git","clone_url":"https://github.com/kirawiley/hint-hint.git","svn_url":"https://github.com/kirawiley/hint-hint","homepage":null,"size":36,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6"},"html":{"href":"https://github.com/kirawiley/hint-hint/pull/6"},"issue":{"href":"https://api.github.com/repos/kirawiley/hint-hint/issues/6"},"comments":{"href":"https://api.github.com/repos/kirawiley/hint-hint/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kirawiley/hint-hint/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/kirawiley/hint-hint/statuses/06a28bf2f9a9682bd9a9e60ee10675e086e90a22"}}}}
{"actor":{"display_login":"victormejia"}}