{"action":"created","comment":{"url":"https://api.github.com/repos/dallaspythondojo/python/pulls/comments/83050596","pull_request_review_id":3916494,"id":83050596,"diff_hunk":"@@ -0,0 +1,44 @@\n+from flask import Flask, render_template, session, request, redirect\n+import random\n+\n+app = Flask(__name__)\n+app.secret_key = 'gold123'\n+\n+@app.route('/')\n+def index():\n+\tif not 'gold' in session:\n+\t\tsession['gold'] = 0\n+\tif not 'activities' in session:\n+\t\tsession['activities'] = []\n+\treturn render_template('ninja1.html', )\n+\n+@app.route('/process', methods = ['POST'])\n+def process():\n+\tlocations = {\n+\t'farm':random.randint(10,20),\n+\t'casino':random.randint(-50,50),\n+\t'cave':random.randint(5,10),\n+\t'house':random.randint(2,5)\n+\t}\n+\tif request.form['location'] in locations:\n+\t\tresult = locations[request.form['location']]\n+\t\tsession['gold'] = session['gold']+result","path":"Smith_Ben/Assignments/ninja_gold copy/ninjagold.py","position":25,"original_position":25,"commit_id":"c381853043f041f2683fec2e3546bc9d26a8e56c","original_commit_id":"c381853043f041f2683fec2e3546bc9d26a8e56c","user":{"login":"chrisulanowicz","id":18199508,"avatar_url":"https://avatars.githubusercontent.com/u/18199508?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisulanowicz","html_url":"https://github.com/chrisulanowicz","followers_url":"https://api.github.com/users/chrisulanowicz/followers","following_url":"https://api.github.com/users/chrisulanowicz/following{/other_user}","gists_url":"https://api.github.com/users/chrisulanowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisulanowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisulanowicz/subscriptions","organizations_url":"https://api.github.com/users/chrisulanowicz/orgs","repos_url":"https://api.github.com/users/chrisulanowicz/repos","events_url":"https://api.github.com/users/chrisulanowicz/events{/privacy}","received_events_url":"https://api.github.com/users/chrisulanowicz/received_events","type":"User","site_admin":false},"body":"Optimization: can also just write         session['gold'] += result","created_at":"2016-10-12T16:57:31Z","updated_at":"2016-10-12T16:57:31Z","html_url":"https://github.com/dallaspythondojo/python/pull/146#discussion_r83050596","pull_request_url":"https://api.github.com/repos/dallaspythondojo/python/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/comments/83050596"},"html":{"href":"https://github.com/dallaspythondojo/python/pull/146#discussion_r83050596"},"pull_request":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/dallaspythondojo/python/pulls/146","id":88661352,"html_url":"https://github.com/dallaspythondojo/python/pull/146","diff_url":"https://github.com/dallaspythondojo/python/pull/146.diff","patch_url":"https://github.com/dallaspythondojo/python/pull/146.patch","issue_url":"https://api.github.com/repos/dallaspythondojo/python/issues/146","number":146,"state":"open","locked":false,"title":"Several projects i finished on Saturday","user":{"login":"benfloydsmith","id":22455613,"avatar_url":"https://avatars.githubusercontent.com/u/22455613?v=3","gravatar_id":"","url":"https://api.github.com/users/benfloydsmith","html_url":"https://github.com/benfloydsmith","followers_url":"https://api.github.com/users/benfloydsmith/followers","following_url":"https://api.github.com/users/benfloydsmith/following{/other_user}","gists_url":"https://api.github.com/users/benfloydsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/benfloydsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfloydsmith/subscriptions","organizations_url":"https://api.github.com/users/benfloydsmith/orgs","repos_url":"https://api.github.com/users/benfloydsmith/repos","events_url":"https://api.github.com/users/benfloydsmith/events{/privacy}","received_events_url":"https://api.github.com/users/benfloydsmith/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-10T13:21:28Z","updated_at":"2016-10-12T16:57:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f6c488fbe5485be9259085bb9d86a4860b1cee2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dallaspythondojo/python/pulls/146/commits","review_comments_url":"https://api.github.com/repos/dallaspythondojo/python/pulls/146/comments","review_comment_url":"https://api.github.com/repos/dallaspythondojo/python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dallaspythondojo/python/issues/146/comments","statuses_url":"https://api.github.com/repos/dallaspythondojo/python/statuses/c381853043f041f2683fec2e3546bc9d26a8e56c","head":{"label":"benfloydsmith:BenSmith_Oct10_0820","ref":"BenSmith_Oct10_0820","sha":"c381853043f041f2683fec2e3546bc9d26a8e56c","user":{"login":"benfloydsmith","id":22455613,"avatar_url":"https://avatars.githubusercontent.com/u/22455613?v=3","gravatar_id":"","url":"https://api.github.com/users/benfloydsmith","html_url":"https://github.com/benfloydsmith","followers_url":"https://api.github.com/users/benfloydsmith/followers","following_url":"https://api.github.com/users/benfloydsmith/following{/other_user}","gists_url":"https://api.github.com/users/benfloydsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/benfloydsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfloydsmith/subscriptions","organizations_url":"https://api.github.com/users/benfloydsmith/orgs","repos_url":"https://api.github.com/users/benfloydsmith/repos","events_url":"https://api.github.com/users/benfloydsmith/events{/privacy}","received_events_url":"https://api.github.com/users/benfloydsmith/received_events","type":"User","site_admin":false},"repo":{"id":70002129,"name":"python","full_name":"benfloydsmith/python","owner":{"login":"benfloydsmith","id":22455613,"avatar_url":"https://avatars.githubusercontent.com/u/22455613?v=3","gravatar_id":"","url":"https://api.github.com/users/benfloydsmith","html_url":"https://github.com/benfloydsmith","followers_url":"https://api.github.com/users/benfloydsmith/followers","following_url":"https://api.github.com/users/benfloydsmith/following{/other_user}","gists_url":"https://api.github.com/users/benfloydsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/benfloydsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfloydsmith/subscriptions","organizations_url":"https://api.github.com/users/benfloydsmith/orgs","repos_url":"https://api.github.com/users/benfloydsmith/repos","events_url":"https://api.github.com/users/benfloydsmith/events{/privacy}","received_events_url":"https://api.github.com/users/benfloydsmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benfloydsmith/python","description":null,"fork":true,"url":"https://api.github.com/repos/benfloydsmith/python","forks_url":"https://api.github.com/repos/benfloydsmith/python/forks","keys_url":"https://api.github.com/repos/benfloydsmith/python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benfloydsmith/python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benfloydsmith/python/teams","hooks_url":"https://api.github.com/repos/benfloydsmith/python/hooks","issue_events_url":"https://api.github.com/repos/benfloydsmith/python/issues/events{/number}","events_url":"https://api.github.com/repos/benfloydsmith/python/events","assignees_url":"https://api.github.com/repos/benfloydsmith/python/assignees{/user}","branches_url":"https://api.github.com/repos/benfloydsmith/python/branches{/branch}","tags_url":"https://api.github.com/repos/benfloydsmith/python/tags","blobs_url":"https://api.github.com/repos/benfloydsmith/python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benfloydsmith/python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benfloydsmith/python/git/refs{/sha}","trees_url":"https://api.github.com/repos/benfloydsmith/python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benfloydsmith/python/statuses/{sha}","languages_url":"https://api.github.com/repos/benfloydsmith/python/languages","stargazers_url":"https://api.github.com/repos/benfloydsmith/python/stargazers","contributors_url":"https://api.github.com/repos/benfloydsmith/python/contributors","subscribers_url":"https://api.github.com/repos/benfloydsmith/python/subscribers","subscription_url":"https://api.github.com/repos/benfloydsmith/python/subscription","commits_url":"https://api.github.com/repos/benfloydsmith/python/commits{/sha}","git_commits_url":"https://api.github.com/repos/benfloydsmith/python/git/commits{/sha}","comments_url":"https://api.github.com/repos/benfloydsmith/python/comments{/number}","issue_comment_url":"https://api.github.com/repos/benfloydsmith/python/issues/comments{/number}","contents_url":"https://api.github.com/repos/benfloydsmith/python/contents/{+path}","compare_url":"https://api.github.com/repos/benfloydsmith/python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benfloydsmith/python/merges","archive_url":"https://api.github.com/repos/benfloydsmith/python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benfloydsmith/python/downloads","issues_url":"https://api.github.com/repos/benfloydsmith/python/issues{/number}","pulls_url":"https://api.github.com/repos/benfloydsmith/python/pulls{/number}","milestones_url":"https://api.github.com/repos/benfloydsmith/python/milestones{/number}","notifications_url":"https://api.github.com/repos/benfloydsmith/python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benfloydsmith/python/labels{/name}","releases_url":"https://api.github.com/repos/benfloydsmith/python/releases{/id}","deployments_url":"https://api.github.com/repos/benfloydsmith/python/deployments","created_at":"2016-10-04T20:11:30Z","updated_at":"2016-10-04T20:11:31Z","pushed_at":"2016-10-12T15:18:43Z","git_url":"git://github.com/benfloydsmith/python.git","ssh_url":"git@github.com:benfloydsmith/python.git","clone_url":"https://github.com/benfloydsmith/python.git","svn_url":"https://github.com/benfloydsmith/python","homepage":null,"size":2620,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"dallaspythondojo:master","ref":"master","sha":"892bad569dcf7d48473711e5ece4d13dccafe797","user":{"login":"dallaspythondojo","id":22594250,"avatar_url":"https://avatars.githubusercontent.com/u/22594250?v=3","gravatar_id":"","url":"https://api.github.com/users/dallaspythondojo","html_url":"https://github.com/dallaspythondojo","followers_url":"https://api.github.com/users/dallaspythondojo/followers","following_url":"https://api.github.com/users/dallaspythondojo/following{/other_user}","gists_url":"https://api.github.com/users/dallaspythondojo/gists{/gist_id}","starred_url":"https://api.github.com/users/dallaspythondojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dallaspythondojo/subscriptions","organizations_url":"https://api.github.com/users/dallaspythondojo/orgs","repos_url":"https://api.github.com/users/dallaspythondojo/repos","events_url":"https://api.github.com/users/dallaspythondojo/events{/privacy}","received_events_url":"https://api.github.com/users/dallaspythondojo/received_events","type":"User","site_admin":false},"repo":{"id":69976602,"name":"python","full_name":"dallaspythondojo/python","owner":{"login":"dallaspythondojo","id":22594250,"avatar_url":"https://avatars.githubusercontent.com/u/22594250?v=3","gravatar_id":"","url":"https://api.github.com/users/dallaspythondojo","html_url":"https://github.com/dallaspythondojo","followers_url":"https://api.github.com/users/dallaspythondojo/followers","following_url":"https://api.github.com/users/dallaspythondojo/following{/other_user}","gists_url":"https://api.github.com/users/dallaspythondojo/gists{/gist_id}","starred_url":"https://api.github.com/users/dallaspythondojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dallaspythondojo/subscriptions","organizations_url":"https://api.github.com/users/dallaspythondojo/orgs","repos_url":"https://api.github.com/users/dallaspythondojo/repos","events_url":"https://api.github.com/users/dallaspythondojo/events{/privacy}","received_events_url":"https://api.github.com/users/dallaspythondojo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dallaspythondojo/python","description":null,"fork":false,"url":"https://api.github.com/repos/dallaspythondojo/python","forks_url":"https://api.github.com/repos/dallaspythondojo/python/forks","keys_url":"https://api.github.com/repos/dallaspythondojo/python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dallaspythondojo/python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dallaspythondojo/python/teams","hooks_url":"https://api.github.com/repos/dallaspythondojo/python/hooks","issue_events_url":"https://api.github.com/repos/dallaspythondojo/python/issues/events{/number}","events_url":"https://api.github.com/repos/dallaspythondojo/python/events","assignees_url":"https://api.github.com/repos/dallaspythondojo/python/assignees{/user}","branches_url":"https://api.github.com/repos/dallaspythondojo/python/branches{/branch}","tags_url":"https://api.github.com/repos/dallaspythondojo/python/tags","blobs_url":"https://api.github.com/repos/dallaspythondojo/python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dallaspythondojo/python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dallaspythondojo/python/git/refs{/sha}","trees_url":"https://api.github.com/repos/dallaspythondojo/python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dallaspythondojo/python/statuses/{sha}","languages_url":"https://api.github.com/repos/dallaspythondojo/python/languages","stargazers_url":"https://api.github.com/repos/dallaspythondojo/python/stargazers","contributors_url":"https://api.github.com/repos/dallaspythondojo/python/contributors","subscribers_url":"https://api.github.com/repos/dallaspythondojo/python/subscribers","subscription_url":"https://api.github.com/repos/dallaspythondojo/python/subscription","commits_url":"https://api.github.com/repos/dallaspythondojo/python/commits{/sha}","git_commits_url":"https://api.github.com/repos/dallaspythondojo/python/git/commits{/sha}","comments_url":"https://api.github.com/repos/dallaspythondojo/python/comments{/number}","issue_comment_url":"https://api.github.com/repos/dallaspythondojo/python/issues/comments{/number}","contents_url":"https://api.github.com/repos/dallaspythondojo/python/contents/{+path}","compare_url":"https://api.github.com/repos/dallaspythondojo/python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dallaspythondojo/python/merges","archive_url":"https://api.github.com/repos/dallaspythondojo/python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dallaspythondojo/python/downloads","issues_url":"https://api.github.com/repos/dallaspythondojo/python/issues{/number}","pulls_url":"https://api.github.com/repos/dallaspythondojo/python/pulls{/number}","milestones_url":"https://api.github.com/repos/dallaspythondojo/python/milestones{/number}","notifications_url":"https://api.github.com/repos/dallaspythondojo/python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dallaspythondojo/python/labels{/name}","releases_url":"https://api.github.com/repos/dallaspythondojo/python/releases{/id}","deployments_url":"https://api.github.com/repos/dallaspythondojo/python/deployments","created_at":"2016-10-04T15:03:58Z","updated_at":"2016-10-05T14:31:06Z","pushed_at":"2016-10-12T16:00:15Z","git_url":"git://github.com/dallaspythondojo/python.git","ssh_url":"git@github.com:dallaspythondojo/python.git","clone_url":"https://github.com/dallaspythondojo/python.git","svn_url":"https://github.com/dallaspythondojo/python","homepage":null,"size":2540,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":56,"forks":22,"open_issues":56,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/146"},"html":{"href":"https://github.com/dallaspythondojo/python/pull/146"},"issue":{"href":"https://api.github.com/repos/dallaspythondojo/python/issues/146"},"comments":{"href":"https://api.github.com/repos/dallaspythondojo/python/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dallaspythondojo/python/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/dallaspythondojo/python/statuses/c381853043f041f2683fec2e3546bc9d26a8e56c"}}}}
{"actor":{"display_login":"chrisulanowicz"}}