{"action":"created","comment":{"url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/comments/67208613","id":67208613,"diff_hunk":"@@ -33,7 +33,33 @@ def street_view\n     end\n \n     def walkscore\n-      @walkscore ||= WalkScore.new hash: read_attribute(:walkscore)\n+      @walkscore ||= WalkScore.new content: read_attribute(:walkscore)\n+    end\n+\n+    def get_walkscore\n+      self.walkscore = WalkScore.new(lat: latitude, lon: longitude).to_h\n+    end\n+\n+    def get_nearest_transit\n+      key = 'parent_station_name'\n+\n+      url = \"http://realtime.mbta.com/developer/api/v2/stopsbylocation?\"\n+      url << \"api_key=#{ENV['MBTA_API_KEY']}\"\n+      url << \"&lat=#{latitude.to_f}&lon=#{longitude.to_f}&format=json\"\n+\n+      puts url\n+\n+      json = JSON.parse(Net::HTTP.get_response(URI(url)).body)\n+\n+      station = json['stop'].detect { |e| e[key].present? }\n+      name = if station\n+        station[key]\n+      else\n+        \"Bus stop: #{json['stop'].first['stop_name']}\"\n+      end\n+      self.nearest_transit = name\n+    rescue StandardError => e","path":"app/models/concerns/development/location.rb","position":30,"original_position":30,"commit_id":"e3f3f77567472679bb7863702517cc214518020b","original_commit_id":"e3f3f77567472679bb7863702517cc214518020b","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Useless assignment to variable - `e`.","created_at":"2016-06-15T17:38:21Z","updated_at":"2016-06-15T17:38:21Z","html_url":"https://github.com/MAPC/developmentdatabase/pull/76#discussion_r67208613","pull_request_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/comments/67208613"},"html":{"href":"https://github.com/MAPC/developmentdatabase/pull/76#discussion_r67208613"},"pull_request":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76","id":73953136,"html_url":"https://github.com/MAPC/developmentdatabase/pull/76","diff_url":"https://github.com/MAPC/developmentdatabase/pull/76.diff","patch_url":"https://github.com/MAPC/developmentdatabase/pull/76.patch","issue_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/76","number":76,"state":"open","locked":false,"title":"Fix Walk Score, nearest transit, and layout","user":{"login":"beechnut","id":1887182,"avatar_url":"https://avatars.githubusercontent.com/u/1887182?v=3","gravatar_id":"","url":"https://api.github.com/users/beechnut","html_url":"https://github.com/beechnut","followers_url":"https://api.github.com/users/beechnut/followers","following_url":"https://api.github.com/users/beechnut/following{/other_user}","gists_url":"https://api.github.com/users/beechnut/gists{/gist_id}","starred_url":"https://api.github.com/users/beechnut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beechnut/subscriptions","organizations_url":"https://api.github.com/users/beechnut/orgs","repos_url":"https://api.github.com/users/beechnut/repos","events_url":"https://api.github.com/users/beechnut/events{/privacy}","received_events_url":"https://api.github.com/users/beechnut/received_events","type":"User","site_admin":false},"body":"Why:\r\n\r\nAfter a demo with Tim, we found that WalkScore, parking spaces, and\r\nnearest transit station were missing.\r\n\r\nWe also decided that Street View was taking up too much page space, and\r\nmight confuse people if it was oriented incorrectly. Also, images that\r\nsay \"no image for this area\" weren't being caught when we asked if the\r\nStreet View is null.\r\n\r\nThis change addresses the need by:\r\n\r\n* Fixed a bug with WalkScore, where passing an option to :hash would\r\ncause it to not be updated.\r\n\r\n* Added an MBTA transit station lookup. If there are no major transit\r\nstations, it uses the nearest bus stop.\r\n\r\n* Alter layout, moving Street View to the sidebar and adding context to\r\nhelp the user understand it's not perfect.\r\n\r\n* Add 'no images in this location' to the list of null street view\r\nimages, so it doesn't display on the show page.\r\n\r\n* Added \"Last Updated\" to empty \"Recent Changes\" feeds.\r\n\r\n* Gave tables footers for rows that represent totals.","created_at":"2016-06-15T17:38:05Z","updated_at":"2016-06-15T17:38:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76/commits","review_comments_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76/comments","review_comment_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/76/comments","statuses_url":"https://api.github.com/repos/MAPC/developmentdatabase/statuses/e3f3f77567472679bb7863702517cc214518020b","head":{"label":"MAPC:attributes/walk-score","ref":"attributes/walk-score","sha":"e3f3f77567472679bb7863702517cc214518020b","user":{"login":"MAPC","id":363825,"avatar_url":"https://avatars.githubusercontent.com/u/363825?v=3","gravatar_id":"","url":"https://api.github.com/users/MAPC","html_url":"https://github.com/MAPC","followers_url":"https://api.github.com/users/MAPC/followers","following_url":"https://api.github.com/users/MAPC/following{/other_user}","gists_url":"https://api.github.com/users/MAPC/gists{/gist_id}","starred_url":"https://api.github.com/users/MAPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAPC/subscriptions","organizations_url":"https://api.github.com/users/MAPC/orgs","repos_url":"https://api.github.com/users/MAPC/repos","events_url":"https://api.github.com/users/MAPC/events{/privacy}","received_events_url":"https://api.github.com/users/MAPC/received_events","type":"Organization","site_admin":false},"repo":{"id":47631689,"name":"developmentdatabase","full_name":"MAPC/developmentdatabase","owner":{"login":"MAPC","id":363825,"avatar_url":"https://avatars.githubusercontent.com/u/363825?v=3","gravatar_id":"","url":"https://api.github.com/users/MAPC","html_url":"https://github.com/MAPC","followers_url":"https://api.github.com/users/MAPC/followers","following_url":"https://api.github.com/users/MAPC/following{/other_user}","gists_url":"https://api.github.com/users/MAPC/gists{/gist_id}","starred_url":"https://api.github.com/users/MAPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAPC/subscriptions","organizations_url":"https://api.github.com/users/MAPC/orgs","repos_url":"https://api.github.com/users/MAPC/repos","events_url":"https://api.github.com/users/MAPC/events{/privacy}","received_events_url":"https://api.github.com/users/MAPC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MAPC/developmentdatabase","description":"Crowdsourcing authoritative info on recent & ongoing developments in Massachusetts.","fork":false,"url":"https://api.github.com/repos/MAPC/developmentdatabase","forks_url":"https://api.github.com/repos/MAPC/developmentdatabase/forks","keys_url":"https://api.github.com/repos/MAPC/developmentdatabase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MAPC/developmentdatabase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MAPC/developmentdatabase/teams","hooks_url":"https://api.github.com/repos/MAPC/developmentdatabase/hooks","issue_events_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/events{/number}","events_url":"https://api.github.com/repos/MAPC/developmentdatabase/events","assignees_url":"https://api.github.com/repos/MAPC/developmentdatabase/assignees{/user}","branches_url":"https://api.github.com/repos/MAPC/developmentdatabase/branches{/branch}","tags_url":"https://api.github.com/repos/MAPC/developmentdatabase/tags","blobs_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/refs{/sha}","trees_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MAPC/developmentdatabase/statuses/{sha}","languages_url":"https://api.github.com/repos/MAPC/developmentdatabase/languages","stargazers_url":"https://api.github.com/repos/MAPC/developmentdatabase/stargazers","contributors_url":"https://api.github.com/repos/MAPC/developmentdatabase/contributors","subscribers_url":"https://api.github.com/repos/MAPC/developmentdatabase/subscribers","subscription_url":"https://api.github.com/repos/MAPC/developmentdatabase/subscription","commits_url":"https://api.github.com/repos/MAPC/developmentdatabase/commits{/sha}","git_commits_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/commits{/sha}","comments_url":"https://api.github.com/repos/MAPC/developmentdatabase/comments{/number}","issue_comment_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/comments{/number}","contents_url":"https://api.github.com/repos/MAPC/developmentdatabase/contents/{+path}","compare_url":"https://api.github.com/repos/MAPC/developmentdatabase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MAPC/developmentdatabase/merges","archive_url":"https://api.github.com/repos/MAPC/developmentdatabase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MAPC/developmentdatabase/downloads","issues_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues{/number}","pulls_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls{/number}","milestones_url":"https://api.github.com/repos/MAPC/developmentdatabase/milestones{/number}","notifications_url":"https://api.github.com/repos/MAPC/developmentdatabase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MAPC/developmentdatabase/labels{/name}","releases_url":"https://api.github.com/repos/MAPC/developmentdatabase/releases{/id}","deployments_url":"https://api.github.com/repos/MAPC/developmentdatabase/deployments","created_at":"2015-12-08T15:44:48Z","updated_at":"2016-03-25T15:14:30Z","pushed_at":"2016-06-15T17:38:05Z","git_url":"git://github.com/MAPC/developmentdatabase.git","ssh_url":"git@github.com:MAPC/developmentdatabase.git","clone_url":"https://github.com/MAPC/developmentdatabase.git","svn_url":"https://github.com/MAPC/developmentdatabase","homepage":"","size":4292,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":0,"default_branch":"develop"}},"base":{"label":"MAPC:org-admin","ref":"org-admin","sha":"a86db9516ab64b97be6d5ca6bdab1db462b03d9c","user":{"login":"MAPC","id":363825,"avatar_url":"https://avatars.githubusercontent.com/u/363825?v=3","gravatar_id":"","url":"https://api.github.com/users/MAPC","html_url":"https://github.com/MAPC","followers_url":"https://api.github.com/users/MAPC/followers","following_url":"https://api.github.com/users/MAPC/following{/other_user}","gists_url":"https://api.github.com/users/MAPC/gists{/gist_id}","starred_url":"https://api.github.com/users/MAPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAPC/subscriptions","organizations_url":"https://api.github.com/users/MAPC/orgs","repos_url":"https://api.github.com/users/MAPC/repos","events_url":"https://api.github.com/users/MAPC/events{/privacy}","received_events_url":"https://api.github.com/users/MAPC/received_events","type":"Organization","site_admin":false},"repo":{"id":47631689,"name":"developmentdatabase","full_name":"MAPC/developmentdatabase","owner":{"login":"MAPC","id":363825,"avatar_url":"https://avatars.githubusercontent.com/u/363825?v=3","gravatar_id":"","url":"https://api.github.com/users/MAPC","html_url":"https://github.com/MAPC","followers_url":"https://api.github.com/users/MAPC/followers","following_url":"https://api.github.com/users/MAPC/following{/other_user}","gists_url":"https://api.github.com/users/MAPC/gists{/gist_id}","starred_url":"https://api.github.com/users/MAPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAPC/subscriptions","organizations_url":"https://api.github.com/users/MAPC/orgs","repos_url":"https://api.github.com/users/MAPC/repos","events_url":"https://api.github.com/users/MAPC/events{/privacy}","received_events_url":"https://api.github.com/users/MAPC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MAPC/developmentdatabase","description":"Crowdsourcing authoritative info on recent & ongoing developments in Massachusetts.","fork":false,"url":"https://api.github.com/repos/MAPC/developmentdatabase","forks_url":"https://api.github.com/repos/MAPC/developmentdatabase/forks","keys_url":"https://api.github.com/repos/MAPC/developmentdatabase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MAPC/developmentdatabase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MAPC/developmentdatabase/teams","hooks_url":"https://api.github.com/repos/MAPC/developmentdatabase/hooks","issue_events_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/events{/number}","events_url":"https://api.github.com/repos/MAPC/developmentdatabase/events","assignees_url":"https://api.github.com/repos/MAPC/developmentdatabase/assignees{/user}","branches_url":"https://api.github.com/repos/MAPC/developmentdatabase/branches{/branch}","tags_url":"https://api.github.com/repos/MAPC/developmentdatabase/tags","blobs_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/refs{/sha}","trees_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MAPC/developmentdatabase/statuses/{sha}","languages_url":"https://api.github.com/repos/MAPC/developmentdatabase/languages","stargazers_url":"https://api.github.com/repos/MAPC/developmentdatabase/stargazers","contributors_url":"https://api.github.com/repos/MAPC/developmentdatabase/contributors","subscribers_url":"https://api.github.com/repos/MAPC/developmentdatabase/subscribers","subscription_url":"https://api.github.com/repos/MAPC/developmentdatabase/subscription","commits_url":"https://api.github.com/repos/MAPC/developmentdatabase/commits{/sha}","git_commits_url":"https://api.github.com/repos/MAPC/developmentdatabase/git/commits{/sha}","comments_url":"https://api.github.com/repos/MAPC/developmentdatabase/comments{/number}","issue_comment_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues/comments{/number}","contents_url":"https://api.github.com/repos/MAPC/developmentdatabase/contents/{+path}","compare_url":"https://api.github.com/repos/MAPC/developmentdatabase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MAPC/developmentdatabase/merges","archive_url":"https://api.github.com/repos/MAPC/developmentdatabase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MAPC/developmentdatabase/downloads","issues_url":"https://api.github.com/repos/MAPC/developmentdatabase/issues{/number}","pulls_url":"https://api.github.com/repos/MAPC/developmentdatabase/pulls{/number}","milestones_url":"https://api.github.com/repos/MAPC/developmentdatabase/milestones{/number}","notifications_url":"https://api.github.com/repos/MAPC/developmentdatabase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MAPC/developmentdatabase/labels{/name}","releases_url":"https://api.github.com/repos/MAPC/developmentdatabase/releases{/id}","deployments_url":"https://api.github.com/repos/MAPC/developmentdatabase/deployments","created_at":"2015-12-08T15:44:48Z","updated_at":"2016-03-25T15:14:30Z","pushed_at":"2016-06-15T17:38:05Z","git_url":"git://github.com/MAPC/developmentdatabase.git","ssh_url":"git@github.com:MAPC/developmentdatabase.git","clone_url":"https://github.com/MAPC/developmentdatabase.git","svn_url":"https://github.com/MAPC/developmentdatabase","homepage":"","size":4292,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76"},"html":{"href":"https://github.com/MAPC/developmentdatabase/pull/76"},"issue":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/issues/76"},"comments":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/MAPC/developmentdatabase/statuses/e3f3f77567472679bb7863702517cc214518020b"}}}}
{"actor":{"display_login":"houndci-bot"}}