{"action":"created","comment":{"url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/comments/231271984","pull_request_review_id":172201249,"id":231271984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTI3MTk4NA==","diff_hunk":"@@ -0,0 +1,43 @@\n+### given more time, error handleing should be thought thorough and implemented\n+\n+import json\n+import requests\n+from pycountry_convert import country_alpha2_to_country_name\n+\n+\n+## part 1\n+\n+my_ip_and_location = requests.get(\"https://ifconfig.co/json\").json()\n+latitude = my_ip_and_location[\"latitude\"]\n+longitude = my_ip_and_location[\"longitude\"]\n+weather_api_url = \"http://api.openweathermap.org/data/2.5/weather?lat={}&lon={}&appid=dec07a75427862501fb3e97181ac04e8&units=metric\".format(latitude, longitude)\n+weather_api_call = requests.get(weather_api_url).json()\n+temperture = weather_api_call[\"main\"][\"temp\"]\n+weather_var = open(\"weather_file.txt\", \"w\")\n+weather_var.write(str(temperture))\n+\n+\n+## part 2\n+\n+#takes a city name and returns and array of temperture and country code\n+def what_temperture_and_country_code(city):\n+    fixed_city_name = city.replace(\" \",\"+\").replace(\"-\",\"+\")\n+    f_weather_api_url = \"http://api.openweathermap.org/data/2.5/weather?q={}&appid=dec07a75427862501fb3e97181ac04e8&units=metric\".format(fixed_city_name)\n+    f_weather_api_call = requests.get(f_weather_api_url).json()\n+    f_temperture = f_weather_api_call[\"main\"][\"temp\"]\n+    f_country_code = f_weather_api_call[\"sys\"][\"country\"]\n+    findings_array = [f_temperture,f_country_code]\n+    return findings_array\n+\n+# main section - prints as asked, some of the country code provided from open weather are not correct and it is not handled in the program\n+cities = [\"Seoul\",\"Tokyo\",\"Tel-Aviv\",\"Kuala Lumpur\",\"Singapore\",\"New York\",\"Dubai\",\"Paris\",\"London\",\"Bangkok\"]\n+temperture_country_code_array = []\n+cities_index = 0\n+for i in cities:\n+     temp_array = what_temperture_and_country_code(i)\n+     temperture_country_code_array.append(temp_array)\n+     full_country_name = country_alpha2_to_country_name(temperture_country_code_array[cities_index][1])","path":"home-assignments/session1/Ex2.py","position":39,"original_position":39,"commit_id":"46da9f6655ce48d6887db6cc3e785157a988ad9a","original_commit_id":"46da9f6655ce48d6887db6cc3e785157a988ad9a","user":{"login":"eyalstoler","id":3054733,"node_id":"MDQ6VXNlcjMwNTQ3MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/3054733?v=4","gravatar_id":"","url":"https://api.github.com/users/eyalstoler","html_url":"https://github.com/eyalstoler","followers_url":"https://api.github.com/users/eyalstoler/followers","following_url":"https://api.github.com/users/eyalstoler/following{/other_user}","gists_url":"https://api.github.com/users/eyalstoler/gists{/gist_id}","starred_url":"https://api.github.com/users/eyalstoler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyalstoler/subscriptions","organizations_url":"https://api.github.com/users/eyalstoler/orgs","repos_url":"https://api.github.com/users/eyalstoler/repos","events_url":"https://api.github.com/users/eyalstoler/events{/privacy}","received_events_url":"https://api.github.com/users/eyalstoler/received_events","type":"User","site_admin":false},"body":"What does that do?","created_at":"2018-11-06T20:03:10Z","updated_at":"2018-11-06T20:09:33Z","html_url":"https://github.com/ops-school/opsschool3-coding/pull/6#discussion_r231271984","pull_request_url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/comments/231271984"},"html":{"href":"https://github.com/ops-school/opsschool3-coding/pull/6#discussion_r231271984"},"pull_request":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6","id":228802251,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4ODAyMjUx","html_url":"https://github.com/ops-school/opsschool3-coding/pull/6","diff_url":"https://github.com/ops-school/opsschool3-coding/pull/6.diff","patch_url":"https://github.com/ops-school/opsschool3-coding/pull/6.patch","issue_url":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/6","number":6,"state":"open","locked":false,"title":"Instructor review check","user":{"login":"eyalstoler","id":3054733,"node_id":"MDQ6VXNlcjMwNTQ3MzM=","avatar_url":"https://avatars3.githubusercontent.com/u/3054733?v=4","gravatar_id":"","url":"https://api.github.com/users/eyalstoler","html_url":"https://github.com/eyalstoler","followers_url":"https://api.github.com/users/eyalstoler/followers","following_url":"https://api.github.com/users/eyalstoler/following{/other_user}","gists_url":"https://api.github.com/users/eyalstoler/gists{/gist_id}","starred_url":"https://api.github.com/users/eyalstoler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyalstoler/subscriptions","organizations_url":"https://api.github.com/users/eyalstoler/orgs","repos_url":"https://api.github.com/users/eyalstoler/repos","events_url":"https://api.github.com/users/eyalstoler/events{/privacy}","received_events_url":"https://api.github.com/users/eyalstoler/received_events","type":"User","site_admin":false},"body":"Opened a Pr for u","created_at":"2018-11-06T19:08:06Z","updated_at":"2018-11-06T20:09:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c8894187f18a93f6c85092a17dbdbfbe6e1208f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6/commits","review_comments_url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6/comments","review_comment_url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/6/comments","statuses_url":"https://api.github.com/repos/ops-school/opsschool3-coding/statuses/46da9f6655ce48d6887db6cc3e785157a988ad9a","head":{"label":"L1nuxProdigy:master","ref":"master","sha":"46da9f6655ce48d6887db6cc3e785157a988ad9a","user":{"login":"L1nuxProdigy","id":42353361,"node_id":"MDQ6VXNlcjQyMzUzMzYx","avatar_url":"https://avatars1.githubusercontent.com/u/42353361?v=4","gravatar_id":"","url":"https://api.github.com/users/L1nuxProdigy","html_url":"https://github.com/L1nuxProdigy","followers_url":"https://api.github.com/users/L1nuxProdigy/followers","following_url":"https://api.github.com/users/L1nuxProdigy/following{/other_user}","gists_url":"https://api.github.com/users/L1nuxProdigy/gists{/gist_id}","starred_url":"https://api.github.com/users/L1nuxProdigy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L1nuxProdigy/subscriptions","organizations_url":"https://api.github.com/users/L1nuxProdigy/orgs","repos_url":"https://api.github.com/users/L1nuxProdigy/repos","events_url":"https://api.github.com/users/L1nuxProdigy/events{/privacy}","received_events_url":"https://api.github.com/users/L1nuxProdigy/received_events","type":"User","site_admin":false},"repo":{"id":156133873,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYxMzM4NzM=","name":"opsschool3-coding","full_name":"L1nuxProdigy/opsschool3-coding","private":false,"owner":{"login":"L1nuxProdigy","id":42353361,"node_id":"MDQ6VXNlcjQyMzUzMzYx","avatar_url":"https://avatars1.githubusercontent.com/u/42353361?v=4","gravatar_id":"","url":"https://api.github.com/users/L1nuxProdigy","html_url":"https://github.com/L1nuxProdigy","followers_url":"https://api.github.com/users/L1nuxProdigy/followers","following_url":"https://api.github.com/users/L1nuxProdigy/following{/other_user}","gists_url":"https://api.github.com/users/L1nuxProdigy/gists{/gist_id}","starred_url":"https://api.github.com/users/L1nuxProdigy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L1nuxProdigy/subscriptions","organizations_url":"https://api.github.com/users/L1nuxProdigy/orgs","repos_url":"https://api.github.com/users/L1nuxProdigy/repos","events_url":"https://api.github.com/users/L1nuxProdigy/events{/privacy}","received_events_url":"https://api.github.com/users/L1nuxProdigy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/L1nuxProdigy/opsschool3-coding","description":null,"fork":true,"url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding","forks_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/forks","keys_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/teams","hooks_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/hooks","issue_events_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/issues/events{/number}","events_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/events","assignees_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/assignees{/user}","branches_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/branches{/branch}","tags_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/tags","blobs_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/git/refs{/sha}","trees_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/statuses/{sha}","languages_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/languages","stargazers_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/stargazers","contributors_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/contributors","subscribers_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/subscribers","subscription_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/subscription","commits_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/commits{/sha}","git_commits_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/git/commits{/sha}","comments_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/comments{/number}","issue_comment_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/issues/comments{/number}","contents_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/contents/{+path}","compare_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/merges","archive_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/downloads","issues_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/issues{/number}","pulls_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/pulls{/number}","milestones_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/milestones{/number}","notifications_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/labels{/name}","releases_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/releases{/id}","deployments_url":"https://api.github.com/repos/L1nuxProdigy/opsschool3-coding/deployments","created_at":"2018-11-04T23:06:32Z","updated_at":"2018-11-05T21:08:18Z","pushed_at":"2018-11-05T21:50:21Z","git_url":"git://github.com/L1nuxProdigy/opsschool3-coding.git","ssh_url":"git@github.com:L1nuxProdigy/opsschool3-coding.git","clone_url":"https://github.com/L1nuxProdigy/opsschool3-coding.git","svn_url":"https://github.com/L1nuxProdigy/opsschool3-coding","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ops-school:master","ref":"master","sha":"a75cab9a077c08ce2d53aabbae72bebe520849b3","user":{"login":"ops-school","id":22130679,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMTMwNjc5","avatar_url":"https://avatars2.githubusercontent.com/u/22130679?v=4","gravatar_id":"","url":"https://api.github.com/users/ops-school","html_url":"https://github.com/ops-school","followers_url":"https://api.github.com/users/ops-school/followers","following_url":"https://api.github.com/users/ops-school/following{/other_user}","gists_url":"https://api.github.com/users/ops-school/gists{/gist_id}","starred_url":"https://api.github.com/users/ops-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ops-school/subscriptions","organizations_url":"https://api.github.com/users/ops-school/orgs","repos_url":"https://api.github.com/users/ops-school/repos","events_url":"https://api.github.com/users/ops-school/events{/privacy}","received_events_url":"https://api.github.com/users/ops-school/received_events","type":"Organization","site_admin":false},"repo":{"id":155730298,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3MzAyOTg=","name":"opsschool3-coding","full_name":"ops-school/opsschool3-coding","private":false,"owner":{"login":"ops-school","id":22130679,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMTMwNjc5","avatar_url":"https://avatars2.githubusercontent.com/u/22130679?v=4","gravatar_id":"","url":"https://api.github.com/users/ops-school","html_url":"https://github.com/ops-school","followers_url":"https://api.github.com/users/ops-school/followers","following_url":"https://api.github.com/users/ops-school/following{/other_user}","gists_url":"https://api.github.com/users/ops-school/gists{/gist_id}","starred_url":"https://api.github.com/users/ops-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ops-school/subscriptions","organizations_url":"https://api.github.com/users/ops-school/orgs","repos_url":"https://api.github.com/users/ops-school/repos","events_url":"https://api.github.com/users/ops-school/events{/privacy}","received_events_url":"https://api.github.com/users/ops-school/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ops-school/opsschool3-coding","description":null,"fork":false,"url":"https://api.github.com/repos/ops-school/opsschool3-coding","forks_url":"https://api.github.com/repos/ops-school/opsschool3-coding/forks","keys_url":"https://api.github.com/repos/ops-school/opsschool3-coding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ops-school/opsschool3-coding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ops-school/opsschool3-coding/teams","hooks_url":"https://api.github.com/repos/ops-school/opsschool3-coding/hooks","issue_events_url":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/events{/number}","events_url":"https://api.github.com/repos/ops-school/opsschool3-coding/events","assignees_url":"https://api.github.com/repos/ops-school/opsschool3-coding/assignees{/user}","branches_url":"https://api.github.com/repos/ops-school/opsschool3-coding/branches{/branch}","tags_url":"https://api.github.com/repos/ops-school/opsschool3-coding/tags","blobs_url":"https://api.github.com/repos/ops-school/opsschool3-coding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ops-school/opsschool3-coding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ops-school/opsschool3-coding/git/refs{/sha}","trees_url":"https://api.github.com/repos/ops-school/opsschool3-coding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ops-school/opsschool3-coding/statuses/{sha}","languages_url":"https://api.github.com/repos/ops-school/opsschool3-coding/languages","stargazers_url":"https://api.github.com/repos/ops-school/opsschool3-coding/stargazers","contributors_url":"https://api.github.com/repos/ops-school/opsschool3-coding/contributors","subscribers_url":"https://api.github.com/repos/ops-school/opsschool3-coding/subscribers","subscription_url":"https://api.github.com/repos/ops-school/opsschool3-coding/subscription","commits_url":"https://api.github.com/repos/ops-school/opsschool3-coding/commits{/sha}","git_commits_url":"https://api.github.com/repos/ops-school/opsschool3-coding/git/commits{/sha}","comments_url":"https://api.github.com/repos/ops-school/opsschool3-coding/comments{/number}","issue_comment_url":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/comments{/number}","contents_url":"https://api.github.com/repos/ops-school/opsschool3-coding/contents/{+path}","compare_url":"https://api.github.com/repos/ops-school/opsschool3-coding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ops-school/opsschool3-coding/merges","archive_url":"https://api.github.com/repos/ops-school/opsschool3-coding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ops-school/opsschool3-coding/downloads","issues_url":"https://api.github.com/repos/ops-school/opsschool3-coding/issues{/number}","pulls_url":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls{/number}","milestones_url":"https://api.github.com/repos/ops-school/opsschool3-coding/milestones{/number}","notifications_url":"https://api.github.com/repos/ops-school/opsschool3-coding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ops-school/opsschool3-coding/labels{/name}","releases_url":"https://api.github.com/repos/ops-school/opsschool3-coding/releases{/id}","deployments_url":"https://api.github.com/repos/ops-school/opsschool3-coding/deployments","created_at":"2018-11-01T14:47:13Z","updated_at":"2018-11-02T04:49:28Z","pushed_at":"2018-11-06T19:08:07Z","git_url":"git://github.com/ops-school/opsschool3-coding.git","ssh_url":"git@github.com:ops-school/opsschool3-coding.git","clone_url":"https://github.com/ops-school/opsschool3-coding.git","svn_url":"https://github.com/ops-school/opsschool3-coding","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":15,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6"},"html":{"href":"https://github.com/ops-school/opsschool3-coding/pull/6"},"issue":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/6"},"comments":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/ops-school/opsschool3-coding/statuses/46da9f6655ce48d6887db6cc3e785157a988ad9a"}},"author_association":"NONE"}}
{"actor":{"display_login":"eyalstoler"}}