{"action":"created","comment":{"url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/comments/44872688","id":44872688,"diff_hunk":"@@ -26,31 +26,34 @@ def get_content(url):\n \n \t# gets the data of air quality and returns an array of dictionaries with data points \n \tdef get_air_quality_data():\n-\t\turl = 'http://safar.tropmet.res.in/map_data.php?for=current&city_id=2'\n-\t\tcontent = get_content(url)\n-\t\tx = ast.literal_eval(content)\n-\t\tair_quality_data = []\n-\t\tfor i in range(0, len(x)):\n-\t\t\ttry:\n-\t\t\t\tair_quality_data_city ={}\n-\t\t\t\tair_quality_data_city['area'] = x[i]['title']\n-\t\t\t\tair_quality_data_city['latitude'] = x[i]['lat']\n-\t\t\t\tair_quality_data_city['longtitude'] = x[i]['lng']\n-\t\t\t\tarea_web_data = BeautifulSoup(x[i]['description'], \"lxml\")\n-\t\t\t\tdata_list = []\n-\t\t\t\tfor data in area_web_data.find_all('td'):\n-\t\t\t\t\tdata_list.append(data.getText())\n-\t\t\t\tair_quality_data_city['time'] = data_list[1]\n-\t\t\t\tair_quality_data_city['pm10'] = int(data_list[6])\n-\t\t\t\tair_quality_data_city['pm2.5'] = int(data_list[9])\n-\t\t\t\tair_quality_data_city['pmno2'] = int(data_list[12])\n-\t\t\t\tair_quality_data_city['pmco'] = int(data_list[15])\n-\t\t\t\tair_quality_data_city['pmo3'] = int(data_list[18])\n-\t\t\t\tair_quality_data.append(air_quality_data_city)\n-\t\t\t\t# print air_quality_data_city\n-\t\t\texcept:\n-\t\t\t\tprint \"Unexpected error:\", sys.exc_info()[0]\n-\t\treturn air_quality_data\n+\t\ttry:\n+\t\t\turl = 'http://safar.tropmet.res.in/map_data.php?for=current&city_id=2'\n+\t\t\tcontent = get_content(url)\n+\t\t\tx = ast.literal_eval(content)\n+\t\t\tair_quality_data = []\n+\t\t\tfor i in range(0, len(x)):\n+\t\t\t\ttry:\n+\t\t\t\t\tair_quality_data_city ={}\n+\t\t\t\t\tair_quality_data_city['area'] = x[i]['title']\n+\t\t\t\t\tair_quality_data_city['latitude'] = x[i]['lat']\n+\t\t\t\t\tair_quality_data_city['longtitude'] = x[i]['lng']\n+\t\t\t\t\tarea_web_data = BeautifulSoup(x[i]['description'], \"lxml\")\n+\t\t\t\t\tdata_list = []\n+\t\t\t\t\tfor data in area_web_data.find_all('td'):\n+\t\t\t\t\t\tdata_list.append(data.getText())\n+\t\t\t\t\tair_quality_data_city['time'] = data_list[1]\n+\t\t\t\t\tair_quality_data_city['pm10'] = int(data_list[6])\n+\t\t\t\t\tair_quality_data_city['pm2.5'] = int(data_list[9])\n+\t\t\t\t\tair_quality_data_city['pmno2'] = int(data_list[12])\n+\t\t\t\t\tair_quality_data_city['pmco'] = int(data_list[15])\n+\t\t\t\t\tair_quality_data_city['pmo3'] = int(data_list[18])\n+\t\t\t\t\tair_quality_data.append(air_quality_data_city)\n+\t\t\t\t\t# print air_quality_data_city\n+\t\t\t\texcept:\n+\t\t\t\t\tprint \"Unexpected error:\", sys.exc_info()[0]\n+\t\t\treturn air_quality_data\n+\t\texcept:\n+\t\t\tprint \"Unexpected error:\", sys.exc_info()[0]","path":"smap/safar_scraper/scraper.py","position":56,"original_position":56,"commit_id":"aee28f3164173e1f8b1bd27083c938b03edeaa67","original_commit_id":"aee28f3164173e1f8b1bd27083c938b03edeaa67","user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"body":"I would log to a file in addition to printing so that we can do log file analysis later","created_at":"2015-11-15T14:52:05Z","updated_at":"2015-11-15T14:52:05Z","html_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1#discussion_r44872688","pull_request_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/comments/44872688"},"html":{"href":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1#discussion_r44872688"},"pull_request":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1","id":50742850,"html_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1","diff_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1.diff","patch_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1.patch","issue_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/1","number":1,"state":"open","locked":false,"title":"Adding Twitter Feed Driver and APIs to the server","user":{"login":"shubhamjain0594","id":5080900,"avatar_url":"https://avatars.githubusercontent.com/u/5080900?v=3","gravatar_id":"","url":"https://api.github.com/users/shubhamjain0594","html_url":"https://github.com/shubhamjain0594","followers_url":"https://api.github.com/users/shubhamjain0594/followers","following_url":"https://api.github.com/users/shubhamjain0594/following{/other_user}","gists_url":"https://api.github.com/users/shubhamjain0594/gists{/gist_id}","starred_url":"https://api.github.com/users/shubhamjain0594/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubhamjain0594/subscriptions","organizations_url":"https://api.github.com/users/shubhamjain0594/orgs","repos_url":"https://api.github.com/users/shubhamjain0594/repos","events_url":"https://api.github.com/users/shubhamjain0594/events{/privacy}","received_events_url":"https://api.github.com/users/shubhamjain0594/received_events","type":"User","site_admin":false},"body":"Added twitter feed driver.\r\nModified SAFAR Drivers.\r\nAdded instructions. \r\nMade API Functional and using it in Twitter Feed.","created_at":"2015-11-15T09:09:32Z","updated_at":"2015-11-15T14:52:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727fe3fb33b2d506b10dbd71332991bb68730caf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1/commits","review_comments_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1/comments","review_comment_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/1/comments","statuses_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/statuses/aee28f3164173e1f8b1bd27083c938b03edeaa67","head":{"label":"shankari:shubhamj","ref":"shubhamj","sha":"aee28f3164173e1f8b1bd27083c938b03edeaa67","user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"repo":{"id":41237623,"name":"Real-Time-Air-Quality-Sensoring-Network","full_name":"shankari/Real-Time-Air-Quality-Sensoring-Network","owner":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network","description":"Creating a network of real time air quality sensors using Dylos Sensors and Raspberry Pi.","fork":false,"url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network","forks_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/forks","keys_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/teams","hooks_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/hooks","issue_events_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/events{/number}","events_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/events","assignees_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/assignees{/user}","branches_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/branches{/branch}","tags_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/tags","blobs_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/refs{/sha}","trees_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/statuses/{sha}","languages_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/languages","stargazers_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/stargazers","contributors_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/contributors","subscribers_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/subscribers","subscription_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/subscription","commits_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/commits{/sha}","git_commits_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/commits{/sha}","comments_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/comments{/number}","issue_comment_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/comments{/number}","contents_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/contents/{+path}","compare_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/merges","archive_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/downloads","issues_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues{/number}","pulls_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls{/number}","milestones_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/milestones{/number}","notifications_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/labels{/name}","releases_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/releases{/id}","created_at":"2015-08-23T05:48:55Z","updated_at":"2015-10-30T09:32:52Z","pushed_at":"2015-11-15T09:09:32Z","git_url":"git://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network.git","ssh_url":"git@github.com:shankari/Real-Time-Air-Quality-Sensoring-Network.git","clone_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network.git","svn_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network","homepage":null,"size":17016,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"shankari:master","ref":"master","sha":"17b62a8ecfca676ce86748da29811b6051c12548","user":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"repo":{"id":41237623,"name":"Real-Time-Air-Quality-Sensoring-Network","full_name":"shankari/Real-Time-Air-Quality-Sensoring-Network","owner":{"login":"shankari","id":2423263,"avatar_url":"https://avatars.githubusercontent.com/u/2423263?v=3","gravatar_id":"","url":"https://api.github.com/users/shankari","html_url":"https://github.com/shankari","followers_url":"https://api.github.com/users/shankari/followers","following_url":"https://api.github.com/users/shankari/following{/other_user}","gists_url":"https://api.github.com/users/shankari/gists{/gist_id}","starred_url":"https://api.github.com/users/shankari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shankari/subscriptions","organizations_url":"https://api.github.com/users/shankari/orgs","repos_url":"https://api.github.com/users/shankari/repos","events_url":"https://api.github.com/users/shankari/events{/privacy}","received_events_url":"https://api.github.com/users/shankari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network","description":"Creating a network of real time air quality sensors using Dylos Sensors and Raspberry Pi.","fork":false,"url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network","forks_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/forks","keys_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/teams","hooks_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/hooks","issue_events_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/events{/number}","events_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/events","assignees_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/assignees{/user}","branches_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/branches{/branch}","tags_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/tags","blobs_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/refs{/sha}","trees_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/statuses/{sha}","languages_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/languages","stargazers_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/stargazers","contributors_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/contributors","subscribers_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/subscribers","subscription_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/subscription","commits_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/commits{/sha}","git_commits_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/git/commits{/sha}","comments_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/comments{/number}","issue_comment_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/comments{/number}","contents_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/contents/{+path}","compare_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/merges","archive_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/downloads","issues_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues{/number}","pulls_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls{/number}","milestones_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/milestones{/number}","notifications_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/labels{/name}","releases_url":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/releases{/id}","created_at":"2015-08-23T05:48:55Z","updated_at":"2015-10-30T09:32:52Z","pushed_at":"2015-11-15T09:09:32Z","git_url":"git://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network.git","ssh_url":"git@github.com:shankari/Real-Time-Air-Quality-Sensoring-Network.git","clone_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network.git","svn_url":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network","homepage":null,"size":17016,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1"},"html":{"href":"https://github.com/shankari/Real-Time-Air-Quality-Sensoring-Network/pull/1"},"issue":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/1"},"comments":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/shankari/Real-Time-Air-Quality-Sensoring-Network/statuses/aee28f3164173e1f8b1bd27083c938b03edeaa67"}}}}