{"action":"created","comment":{"url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/comments/43345366","id":43345366,"diff_hunk":"@@ -0,0 +1,76 @@\n+#\n+#   A web app written with Flask and Twilio. The app allows\n+#   you to call a phone and it automatically says the specified \n+#   name (Daniel Prado), and the title of the top content on\n+#   Reddit at the time the call is made. The user is required to\n+#\tinput their authentication token, account SID, the number they\n+#\tare calling from (a number associated with the account), the\n+#\tnumber they are calling, and when the call is to be made (date and time)\n+#\n+\n+import time\n+from datetime import datetime\n+from datetime import timedelta\n+from flask import Flask, request, session, url_for, redirect, \\\n+     render_template, abort, g, flash, _app_ctx_stack\n+from twilio.rest import TwilioRestClient\n+from threading import Timer\n+\n+# configuration\n+SECRET_KEY = 'development key'\n+\n+# Creat the app\n+app = Flask(__name__)\n+app.config.from_object(__name__)\n+app.config.from_envvar('MINITWIT_SETTINGS', silent=True)\n+\n+\n+# Loads the web page\n+@app.route('/')\n+def public_calls():\n+\treturn render_template('layout.html')\n+\n+\n+# Handles registering a call\n+@app.route('/add_call', methods=['POST'])\n+def add_call():\n+\t# Get inputs from form\n+\tcallNumber = request.form['call_number']\n+\tcallFrom = request.form['call_number_from']\n+\taccountSid = request.form['account_sid']\n+\tauthToken = request.form['auth_token']\n+\ttimeToCall = request.form['time_to_call']\n+\n+\t# Check to see if any entries were left blank\n+\tif (callNumber and callFrom and accountSid and authToken and timeToCall):\n+\t\t# Take date input and change to python datetime\n+\t\tcallTimeLocal = datetime(*[int(v) for v in timeToCall.replace('T', '-').replace(':', '-').split('-')])\n+\n+\t\ttimeOfRequestUTC=datetime.today()\n+\t\t\n+\t\t# Offset Eastern Standard Time to UTC\n+\t\tcallTimeUTC = timedelta(0,14400) + callTimeLocal","path":"makeCalls.py","position":52,"original_position":52,"commit_id":"8443ff9c4cccf7640b01405137a3229b9a093137","original_commit_id":"8443ff9c4cccf7640b01405137a3229b9a093137","user":{"login":"nowell-jana","id":5712935,"avatar_url":"https://avatars.githubusercontent.com/u/5712935?v=3","gravatar_id":"","url":"https://api.github.com/users/nowell-jana","html_url":"https://github.com/nowell-jana","followers_url":"https://api.github.com/users/nowell-jana/followers","following_url":"https://api.github.com/users/nowell-jana/following{/other_user}","gists_url":"https://api.github.com/users/nowell-jana/gists{/gist_id}","starred_url":"https://api.github.com/users/nowell-jana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nowell-jana/subscriptions","organizations_url":"https://api.github.com/users/nowell-jana/orgs","repos_url":"https://api.github.com/users/nowell-jana/repos","events_url":"https://api.github.com/users/nowell-jana/events{/privacy}","received_events_url":"https://api.github.com/users/nowell-jana/received_events","type":"User","site_admin":false},"body":"Better to avoid doing date math and find a way to have Python do the conversion for you.  For instance, this wouldn't be quite right during EDT (granted, you won't be running this indefinitely...I think?).","created_at":"2015-10-29T03:19:11Z","updated_at":"2015-10-29T03:19:11Z","html_url":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2#discussion_r43345366","pull_request_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/comments/43345366"},"html":{"href":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2#discussion_r43345366"},"pull_request":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2","id":48760100,"html_url":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2","diff_url":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2.diff","patch_url":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2.patch","issue_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/2","number":2,"state":"open","locked":false,"title":"Twil call","user":{"login":"DanielPradoSanchez","id":10534619,"avatar_url":"https://avatars.githubusercontent.com/u/10534619?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielPradoSanchez","html_url":"https://github.com/DanielPradoSanchez","followers_url":"https://api.github.com/users/DanielPradoSanchez/followers","following_url":"https://api.github.com/users/DanielPradoSanchez/following{/other_user}","gists_url":"https://api.github.com/users/DanielPradoSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielPradoSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielPradoSanchez/subscriptions","organizations_url":"https://api.github.com/users/DanielPradoSanchez/orgs","repos_url":"https://api.github.com/users/DanielPradoSanchez/repos","events_url":"https://api.github.com/users/DanielPradoSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/DanielPradoSanchez/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-26T16:09:49Z","updated_at":"2015-10-29T03:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9bc9b2b6e35bef986c636801344ae586d7c1a81","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2/commits","review_comments_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2/comments","review_comment_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/2/comments","statuses_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/statuses/8443ff9c4cccf7640b01405137a3229b9a093137","head":{"label":"DanielPradoSanchez:TwilCall","ref":"TwilCall","sha":"8443ff9c4cccf7640b01405137a3229b9a093137","user":{"login":"DanielPradoSanchez","id":10534619,"avatar_url":"https://avatars.githubusercontent.com/u/10534619?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielPradoSanchez","html_url":"https://github.com/DanielPradoSanchez","followers_url":"https://api.github.com/users/DanielPradoSanchez/followers","following_url":"https://api.github.com/users/DanielPradoSanchez/following{/other_user}","gists_url":"https://api.github.com/users/DanielPradoSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielPradoSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielPradoSanchez/subscriptions","organizations_url":"https://api.github.com/users/DanielPradoSanchez/orgs","repos_url":"https://api.github.com/users/DanielPradoSanchez/repos","events_url":"https://api.github.com/users/DanielPradoSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/DanielPradoSanchez/received_events","type":"User","site_admin":false},"repo":{"id":44884030,"name":"CallingWebApp","full_name":"DanielPradoSanchez/CallingWebApp","owner":{"login":"DanielPradoSanchez","id":10534619,"avatar_url":"https://avatars.githubusercontent.com/u/10534619?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielPradoSanchez","html_url":"https://github.com/DanielPradoSanchez","followers_url":"https://api.github.com/users/DanielPradoSanchez/followers","following_url":"https://api.github.com/users/DanielPradoSanchez/following{/other_user}","gists_url":"https://api.github.com/users/DanielPradoSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielPradoSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielPradoSanchez/subscriptions","organizations_url":"https://api.github.com/users/DanielPradoSanchez/orgs","repos_url":"https://api.github.com/users/DanielPradoSanchez/repos","events_url":"https://api.github.com/users/DanielPradoSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/DanielPradoSanchez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanielPradoSanchez/CallingWebApp","description":"","fork":false,"url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp","forks_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/forks","keys_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/teams","hooks_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/hooks","issue_events_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/events{/number}","events_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/events","assignees_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/assignees{/user}","branches_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/branches{/branch}","tags_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/tags","blobs_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/statuses/{sha}","languages_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/languages","stargazers_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/stargazers","contributors_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/contributors","subscribers_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/subscribers","subscription_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/subscription","commits_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/contents/{+path}","compare_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/merges","archive_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/downloads","issues_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues{/number}","pulls_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls{/number}","milestones_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/milestones{/number}","notifications_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/labels{/name}","releases_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/releases{/id}","created_at":"2015-10-24T20:46:01Z","updated_at":"2015-10-24T20:46:01Z","pushed_at":"2015-10-27T21:02:36Z","git_url":"git://github.com/DanielPradoSanchez/CallingWebApp.git","ssh_url":"git@github.com:DanielPradoSanchez/CallingWebApp.git","clone_url":"https://github.com/DanielPradoSanchez/CallingWebApp.git","svn_url":"https://github.com/DanielPradoSanchez/CallingWebApp","homepage":null,"size":6304,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DanielPradoSanchez:master","ref":"master","sha":"efce4f1caf1f8f546db687ea5876cded555ff456","user":{"login":"DanielPradoSanchez","id":10534619,"avatar_url":"https://avatars.githubusercontent.com/u/10534619?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielPradoSanchez","html_url":"https://github.com/DanielPradoSanchez","followers_url":"https://api.github.com/users/DanielPradoSanchez/followers","following_url":"https://api.github.com/users/DanielPradoSanchez/following{/other_user}","gists_url":"https://api.github.com/users/DanielPradoSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielPradoSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielPradoSanchez/subscriptions","organizations_url":"https://api.github.com/users/DanielPradoSanchez/orgs","repos_url":"https://api.github.com/users/DanielPradoSanchez/repos","events_url":"https://api.github.com/users/DanielPradoSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/DanielPradoSanchez/received_events","type":"User","site_admin":false},"repo":{"id":44884030,"name":"CallingWebApp","full_name":"DanielPradoSanchez/CallingWebApp","owner":{"login":"DanielPradoSanchez","id":10534619,"avatar_url":"https://avatars.githubusercontent.com/u/10534619?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielPradoSanchez","html_url":"https://github.com/DanielPradoSanchez","followers_url":"https://api.github.com/users/DanielPradoSanchez/followers","following_url":"https://api.github.com/users/DanielPradoSanchez/following{/other_user}","gists_url":"https://api.github.com/users/DanielPradoSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielPradoSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielPradoSanchez/subscriptions","organizations_url":"https://api.github.com/users/DanielPradoSanchez/orgs","repos_url":"https://api.github.com/users/DanielPradoSanchez/repos","events_url":"https://api.github.com/users/DanielPradoSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/DanielPradoSanchez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanielPradoSanchez/CallingWebApp","description":"","fork":false,"url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp","forks_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/forks","keys_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/teams","hooks_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/hooks","issue_events_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/events{/number}","events_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/events","assignees_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/assignees{/user}","branches_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/branches{/branch}","tags_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/tags","blobs_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/statuses/{sha}","languages_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/languages","stargazers_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/stargazers","contributors_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/contributors","subscribers_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/subscribers","subscription_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/subscription","commits_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/contents/{+path}","compare_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/merges","archive_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/downloads","issues_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues{/number}","pulls_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls{/number}","milestones_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/milestones{/number}","notifications_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/labels{/name}","releases_url":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/releases{/id}","created_at":"2015-10-24T20:46:01Z","updated_at":"2015-10-24T20:46:01Z","pushed_at":"2015-10-27T21:02:36Z","git_url":"git://github.com/DanielPradoSanchez/CallingWebApp.git","ssh_url":"git@github.com:DanielPradoSanchez/CallingWebApp.git","clone_url":"https://github.com/DanielPradoSanchez/CallingWebApp.git","svn_url":"https://github.com/DanielPradoSanchez/CallingWebApp","homepage":null,"size":6304,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2"},"html":{"href":"https://github.com/DanielPradoSanchez/CallingWebApp/pull/2"},"issue":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/2"},"comments":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/DanielPradoSanchez/CallingWebApp/statuses/8443ff9c4cccf7640b01405137a3229b9a093137"}}}}