{"action":"created","comment":{"url":"https://api.github.com/repos/open-austin/permit-server/pulls/comments/72004466","id":72004466,"diff_hunk":"@@ -0,0 +1,95 @@\n+var request = require('request');\n+var _ = require('lodash');\n+\n+// REST url for geocoding api\n+var GEOCODE_ENDPOINT = 'http://www.austintexas.gov/GIS/REST/Geocode/COA_Composite_Locator/GeocodeServer/findAddressCandidates';\n+\n+// local historical districts\n+var HIST_DIST_QUERY = 'http://services.arcgis.com/0L95CJ0VTaxqcmED/ArcGIS/rest/services/PLANNINGCADASTRE_zoning_ordinance/FeatureServer/0/query';\n+// Returns top N address for given address, ranked by score 0-100\n+// could also be done with a cutoff on scores\n+var RETURN_N_CANDIDATES = 10;\n+\n+function getAddressCandidates(addr, callback) {\n+    var params = {\n+        uri: GEOCODE_ENDPOINT,\n+        qs: {\n+            street: addr,\n+            f: 'pjson'\n+        }\n+    };\n+\n+    request(params, function(err, res, body) {\n+        var result = null;\n+        if(!err && res.statusCode == 200) {\n+            body = JSON.parse(body);\n+            var top = _.take(body.candidates, RETURN_N_CANDIDATES);","path":"lib/geo.js","position":26,"original_position":26,"commit_id":"05c29af0599181341a1ceb54e44f55be85dfb4c8","original_commit_id":"05c29af0599181341a1ceb54e44f55be85dfb4c8","user":{"login":"prestonp","id":1265379,"avatar_url":"https://avatars.githubusercontent.com/u/1265379?v=3","gravatar_id":"","url":"https://api.github.com/users/prestonp","html_url":"https://github.com/prestonp","followers_url":"https://api.github.com/users/prestonp/followers","following_url":"https://api.github.com/users/prestonp/following{/other_user}","gists_url":"https://api.github.com/users/prestonp/gists{/gist_id}","starred_url":"https://api.github.com/users/prestonp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestonp/subscriptions","organizations_url":"https://api.github.com/users/prestonp/orgs","repos_url":"https://api.github.com/users/prestonp/repos","events_url":"https://api.github.com/users/prestonp/events{/privacy}","received_events_url":"https://api.github.com/users/prestonp/received_events","type":"User","site_admin":false},"body":"Hey since we're only using `_.take` we could probably just use `body.candidates.slice(0, RETURN_N_CANDIDATES)` instead of bringing in the entire lodash lib","created_at":"2016-07-25T03:00:49Z","updated_at":"2016-07-25T03:00:49Z","html_url":"https://github.com/open-austin/permit-server/pull/52#discussion_r72004466","pull_request_url":"https://api.github.com/repos/open-austin/permit-server/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/comments/72004466"},"html":{"href":"https://github.com/open-austin/permit-server/pull/52#discussion_r72004466"},"pull_request":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/open-austin/permit-server/pulls/52","id":78563020,"html_url":"https://github.com/open-austin/permit-server/pull/52","diff_url":"https://github.com/open-austin/permit-server/pull/52.diff","patch_url":"https://github.com/open-austin/permit-server/pull/52.patch","issue_url":"https://api.github.com/repos/open-austin/permit-server/issues/52","number":52,"state":"open","locked":false,"title":"Geocode client","user":{"login":"daniellillja","id":9342133,"avatar_url":"https://avatars.githubusercontent.com/u/9342133?v=3","gravatar_id":"","url":"https://api.github.com/users/daniellillja","html_url":"https://github.com/daniellillja","followers_url":"https://api.github.com/users/daniellillja/followers","following_url":"https://api.github.com/users/daniellillja/following{/other_user}","gists_url":"https://api.github.com/users/daniellillja/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellillja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellillja/subscriptions","organizations_url":"https://api.github.com/users/daniellillja/orgs","repos_url":"https://api.github.com/users/daniellillja/repos","events_url":"https://api.github.com/users/daniellillja/events{/privacy}","received_events_url":"https://api.github.com/users/daniellillja/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-23T04:31:09Z","updated_at":"2016-07-25T03:00:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37094c137200896a400799e9f83fe08b580893cd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-austin/permit-server/pulls/52/commits","review_comments_url":"https://api.github.com/repos/open-austin/permit-server/pulls/52/comments","review_comment_url":"https://api.github.com/repos/open-austin/permit-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-austin/permit-server/issues/52/comments","statuses_url":"https://api.github.com/repos/open-austin/permit-server/statuses/05c29af0599181341a1ceb54e44f55be85dfb4c8","head":{"label":"daniellillja:geocode-client","ref":"geocode-client","sha":"05c29af0599181341a1ceb54e44f55be85dfb4c8","user":{"login":"daniellillja","id":9342133,"avatar_url":"https://avatars.githubusercontent.com/u/9342133?v=3","gravatar_id":"","url":"https://api.github.com/users/daniellillja","html_url":"https://github.com/daniellillja","followers_url":"https://api.github.com/users/daniellillja/followers","following_url":"https://api.github.com/users/daniellillja/following{/other_user}","gists_url":"https://api.github.com/users/daniellillja/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellillja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellillja/subscriptions","organizations_url":"https://api.github.com/users/daniellillja/orgs","repos_url":"https://api.github.com/users/daniellillja/repos","events_url":"https://api.github.com/users/daniellillja/events{/privacy}","received_events_url":"https://api.github.com/users/daniellillja/received_events","type":"User","site_admin":false},"repo":{"id":63207542,"name":"permit-server","full_name":"daniellillja/permit-server","owner":{"login":"daniellillja","id":9342133,"avatar_url":"https://avatars.githubusercontent.com/u/9342133?v=3","gravatar_id":"","url":"https://api.github.com/users/daniellillja","html_url":"https://github.com/daniellillja","followers_url":"https://api.github.com/users/daniellillja/followers","following_url":"https://api.github.com/users/daniellillja/following{/other_user}","gists_url":"https://api.github.com/users/daniellillja/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellillja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellillja/subscriptions","organizations_url":"https://api.github.com/users/daniellillja/orgs","repos_url":"https://api.github.com/users/daniellillja/repos","events_url":"https://api.github.com/users/daniellillja/events{/privacy}","received_events_url":"https://api.github.com/users/daniellillja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniellillja/permit-server","description":null,"fork":true,"url":"https://api.github.com/repos/daniellillja/permit-server","forks_url":"https://api.github.com/repos/daniellillja/permit-server/forks","keys_url":"https://api.github.com/repos/daniellillja/permit-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniellillja/permit-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniellillja/permit-server/teams","hooks_url":"https://api.github.com/repos/daniellillja/permit-server/hooks","issue_events_url":"https://api.github.com/repos/daniellillja/permit-server/issues/events{/number}","events_url":"https://api.github.com/repos/daniellillja/permit-server/events","assignees_url":"https://api.github.com/repos/daniellillja/permit-server/assignees{/user}","branches_url":"https://api.github.com/repos/daniellillja/permit-server/branches{/branch}","tags_url":"https://api.github.com/repos/daniellillja/permit-server/tags","blobs_url":"https://api.github.com/repos/daniellillja/permit-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniellillja/permit-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniellillja/permit-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniellillja/permit-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniellillja/permit-server/statuses/{sha}","languages_url":"https://api.github.com/repos/daniellillja/permit-server/languages","stargazers_url":"https://api.github.com/repos/daniellillja/permit-server/stargazers","contributors_url":"https://api.github.com/repos/daniellillja/permit-server/contributors","subscribers_url":"https://api.github.com/repos/daniellillja/permit-server/subscribers","subscription_url":"https://api.github.com/repos/daniellillja/permit-server/subscription","commits_url":"https://api.github.com/repos/daniellillja/permit-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniellillja/permit-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniellillja/permit-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniellillja/permit-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniellillja/permit-server/contents/{+path}","compare_url":"https://api.github.com/repos/daniellillja/permit-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniellillja/permit-server/merges","archive_url":"https://api.github.com/repos/daniellillja/permit-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniellillja/permit-server/downloads","issues_url":"https://api.github.com/repos/daniellillja/permit-server/issues{/number}","pulls_url":"https://api.github.com/repos/daniellillja/permit-server/pulls{/number}","milestones_url":"https://api.github.com/repos/daniellillja/permit-server/milestones{/number}","notifications_url":"https://api.github.com/repos/daniellillja/permit-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniellillja/permit-server/labels{/name}","releases_url":"https://api.github.com/repos/daniellillja/permit-server/releases{/id}","deployments_url":"https://api.github.com/repos/daniellillja/permit-server/deployments","created_at":"2016-07-13T02:28:03Z","updated_at":"2016-07-13T02:28:05Z","pushed_at":"2016-07-23T04:30:30Z","git_url":"git://github.com/daniellillja/permit-server.git","ssh_url":"git@github.com:daniellillja/permit-server.git","clone_url":"https://github.com/daniellillja/permit-server.git","svn_url":"https://github.com/daniellillja/permit-server","homepage":"https://permit-wiz.herokuapp.com","size":17607,"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":"open-austin:master","ref":"master","sha":"e2314e1537e663509a221238bc794b56477b15d5","user":{"login":"open-austin","id":970084,"avatar_url":"https://avatars.githubusercontent.com/u/970084?v=3","gravatar_id":"","url":"https://api.github.com/users/open-austin","html_url":"https://github.com/open-austin","followers_url":"https://api.github.com/users/open-austin/followers","following_url":"https://api.github.com/users/open-austin/following{/other_user}","gists_url":"https://api.github.com/users/open-austin/gists{/gist_id}","starred_url":"https://api.github.com/users/open-austin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-austin/subscriptions","organizations_url":"https://api.github.com/users/open-austin/orgs","repos_url":"https://api.github.com/users/open-austin/repos","events_url":"https://api.github.com/users/open-austin/events{/privacy}","received_events_url":"https://api.github.com/users/open-austin/received_events","type":"Organization","site_admin":false},"repo":{"id":60430589,"name":"permit-server","full_name":"open-austin/permit-server","owner":{"login":"open-austin","id":970084,"avatar_url":"https://avatars.githubusercontent.com/u/970084?v=3","gravatar_id":"","url":"https://api.github.com/users/open-austin","html_url":"https://github.com/open-austin","followers_url":"https://api.github.com/users/open-austin/followers","following_url":"https://api.github.com/users/open-austin/following{/other_user}","gists_url":"https://api.github.com/users/open-austin/gists{/gist_id}","starred_url":"https://api.github.com/users/open-austin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-austin/subscriptions","organizations_url":"https://api.github.com/users/open-austin/orgs","repos_url":"https://api.github.com/users/open-austin/repos","events_url":"https://api.github.com/users/open-austin/events{/privacy}","received_events_url":"https://api.github.com/users/open-austin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-austin/permit-server","description":"","fork":false,"url":"https://api.github.com/repos/open-austin/permit-server","forks_url":"https://api.github.com/repos/open-austin/permit-server/forks","keys_url":"https://api.github.com/repos/open-austin/permit-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-austin/permit-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-austin/permit-server/teams","hooks_url":"https://api.github.com/repos/open-austin/permit-server/hooks","issue_events_url":"https://api.github.com/repos/open-austin/permit-server/issues/events{/number}","events_url":"https://api.github.com/repos/open-austin/permit-server/events","assignees_url":"https://api.github.com/repos/open-austin/permit-server/assignees{/user}","branches_url":"https://api.github.com/repos/open-austin/permit-server/branches{/branch}","tags_url":"https://api.github.com/repos/open-austin/permit-server/tags","blobs_url":"https://api.github.com/repos/open-austin/permit-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-austin/permit-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-austin/permit-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-austin/permit-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-austin/permit-server/statuses/{sha}","languages_url":"https://api.github.com/repos/open-austin/permit-server/languages","stargazers_url":"https://api.github.com/repos/open-austin/permit-server/stargazers","contributors_url":"https://api.github.com/repos/open-austin/permit-server/contributors","subscribers_url":"https://api.github.com/repos/open-austin/permit-server/subscribers","subscription_url":"https://api.github.com/repos/open-austin/permit-server/subscription","commits_url":"https://api.github.com/repos/open-austin/permit-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-austin/permit-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-austin/permit-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-austin/permit-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-austin/permit-server/contents/{+path}","compare_url":"https://api.github.com/repos/open-austin/permit-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-austin/permit-server/merges","archive_url":"https://api.github.com/repos/open-austin/permit-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-austin/permit-server/downloads","issues_url":"https://api.github.com/repos/open-austin/permit-server/issues{/number}","pulls_url":"https://api.github.com/repos/open-austin/permit-server/pulls{/number}","milestones_url":"https://api.github.com/repos/open-austin/permit-server/milestones{/number}","notifications_url":"https://api.github.com/repos/open-austin/permit-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-austin/permit-server/labels{/name}","releases_url":"https://api.github.com/repos/open-austin/permit-server/releases{/id}","deployments_url":"https://api.github.com/repos/open-austin/permit-server/deployments","created_at":"2016-06-04T21:17:10Z","updated_at":"2016-06-06T15:44:22Z","pushed_at":"2016-07-23T04:31:10Z","git_url":"git://github.com/open-austin/permit-server.git","ssh_url":"git@github.com:open-austin/permit-server.git","clone_url":"https://github.com/open-austin/permit-server.git","svn_url":"https://github.com/open-austin/permit-server","homepage":"https://permit-wiz.herokuapp.com","size":17606,"stargazers_count":5,"watchers_count":5,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":14,"forks":4,"open_issues":14,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/52"},"html":{"href":"https://github.com/open-austin/permit-server/pull/52"},"issue":{"href":"https://api.github.com/repos/open-austin/permit-server/issues/52"},"comments":{"href":"https://api.github.com/repos/open-austin/permit-server/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-austin/permit-server/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/open-austin/permit-server/statuses/05c29af0599181341a1ceb54e44f55be85dfb4c8"}}}}
{"actor":{"display_login":"prestonp"}}