{"action":"created","comment":{"url":"https://api.github.com/repos/prey/prey-node-client/pulls/comments/34624497","id":34624497,"diff_hunk":"@@ -0,0 +1,121 @@\n+\"use strict\"\n+\n+var join = require('path').join,\n+  needle = require('needle'),\n+  get_agent = require('random-ua').generate,\n+  platform = require(join(__dirname, process.platform)),\n+  providers = require('./../../providers'),\n+  logger = require('../../common').logger.prefix('geo');\n+\n+function geoip(cb) {\n+\n+  logger.debug(\"Getting location via geoip\");\n+\n+  needle.get('http://ipinfo.io/geo', function(err, resp, body) {\n+    if (!body || !body.loc) {\n+      return cb(err || new Error('Unable to get location from IP.'));\n+    }\n+\n+    logger.debug(\"Got location via geoip\");\n+\n+    var res = {\n+      lat: parseFloat(body.loc.split(',')[0]),\n+      lng: parseFloat(body.loc.split(',')[1]),\n+      method: 'geoip'\n+    }\n+\n+    cb(null, res);\n+  })\n+}\n+\n+function google(cb) {\n+","path":"lib/agent/providers/geo/strategies.js","position":32,"original_position":32,"commit_id":"701d9b9db9c1e2e3a88aae35ba4d2bd06ebf377f","original_commit_id":"701d9b9db9c1e2e3a88aae35ba4d2bd06ebf377f","user":{"login":"raliste","id":388935,"avatar_url":"https://avatars.githubusercontent.com/u/388935?v=3","gravatar_id":"","url":"https://api.github.com/users/raliste","html_url":"https://github.com/raliste","followers_url":"https://api.github.com/users/raliste/followers","following_url":"https://api.github.com/users/raliste/following{/other_user}","gists_url":"https://api.github.com/users/raliste/gists{/gist_id}","starred_url":"https://api.github.com/users/raliste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raliste/subscriptions","organizations_url":"https://api.github.com/users/raliste/orgs","repos_url":"https://api.github.com/users/raliste/repos","events_url":"https://api.github.com/users/raliste/events{/privacy}","received_events_url":"https://api.github.com/users/raliste/received_events","type":"User","site_admin":false},"body":"Extra lines, not consistent with previous style. Review extra lines moving down as well.","created_at":"2015-07-14T21:52:01Z","updated_at":"2015-07-14T21:52:01Z","html_url":"https://github.com/prey/prey-node-client/pull/139#discussion_r34624497","pull_request_url":"https://api.github.com/repos/prey/prey-node-client/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/comments/34624497"},"html":{"href":"https://github.com/prey/prey-node-client/pull/139#discussion_r34624497"},"pull_request":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/prey/prey-node-client/pulls/139","id":39015303,"html_url":"https://github.com/prey/prey-node-client/pull/139","diff_url":"https://github.com/prey/prey-node-client/pull/139.diff","patch_url":"https://github.com/prey/prey-node-client/pull/139.patch","issue_url":"https://api.github.com/repos/prey/prey-node-client/issues/139","number":139,"state":"open","locked":false,"title":"Add native geolocation as main geoloc strategy.","user":{"login":"lemavri","id":844344,"avatar_url":"https://avatars.githubusercontent.com/u/844344?v=3","gravatar_id":"","url":"https://api.github.com/users/lemavri","html_url":"https://github.com/lemavri","followers_url":"https://api.github.com/users/lemavri/followers","following_url":"https://api.github.com/users/lemavri/following{/other_user}","gists_url":"https://api.github.com/users/lemavri/gists{/gist_id}","starred_url":"https://api.github.com/users/lemavri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemavri/subscriptions","organizations_url":"https://api.github.com/users/lemavri/orgs","repos_url":"https://api.github.com/users/lemavri/repos","events_url":"https://api.github.com/users/lemavri/events{/privacy}","received_events_url":"https://api.github.com/users/lemavri/received_events","type":"User","site_admin":false},"body":"This is a rebased version of the location branch.\r\n\r\nTODO\r\n\r\n- [x] Fallback to alternative geoloc strategy (not GeoIP, which sucks)\r\n- [x] Big G geoloc specs\r\n- [x] Native Geoloc specs\r\n- [x] GeoIP specs\r\n- [x] Preliminary build + QA\r\n\r\n---\r\n\r\ndevlog: \r\n\r\nThis error is returned when trying to use native geoloc in Windows (Surface) when running Prey 64-bit. When running 32-bit it works as expected.\r\n```\r\nError: Unable to load geolocation module: %1 is not a valid Win32 application.\r\nC:\\Windows\\Prey\\versions\\1.4.1\\lib\\agent\\providers\\geo\\win32\\windows.devices.geolocation\\build\\release\\binding.node\r\n```\r\n\r\nwhereami is not prompting user to give permissions to access the location when ran from Prey. Perhaps we need to add it manually by running `defaults write /var/db/locationd/clients.plist` in the post_install script.\r\n\r\n","created_at":"2015-07-01T19:13:48Z","updated_at":"2015-07-14T21:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00d6910ba8c8f5372bda68267f1d3d5dd5a02b29","assignee":{"login":"lemavri","id":844344,"avatar_url":"https://avatars.githubusercontent.com/u/844344?v=3","gravatar_id":"","url":"https://api.github.com/users/lemavri","html_url":"https://github.com/lemavri","followers_url":"https://api.github.com/users/lemavri/followers","following_url":"https://api.github.com/users/lemavri/following{/other_user}","gists_url":"https://api.github.com/users/lemavri/gists{/gist_id}","starred_url":"https://api.github.com/users/lemavri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemavri/subscriptions","organizations_url":"https://api.github.com/users/lemavri/orgs","repos_url":"https://api.github.com/users/lemavri/repos","events_url":"https://api.github.com/users/lemavri/events{/privacy}","received_events_url":"https://api.github.com/users/lemavri/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/prey/prey-node-client/milestones/4","html_url":"https://github.com/prey/prey-node-client/milestones/1.4.0","labels_url":"https://api.github.com/repos/prey/prey-node-client/milestones/4/labels","id":1207815,"number":4,"title":"1.4.0","description":"","creator":{"login":"lemavri","id":844344,"avatar_url":"https://avatars.githubusercontent.com/u/844344?v=3","gravatar_id":"","url":"https://api.github.com/users/lemavri","html_url":"https://github.com/lemavri","followers_url":"https://api.github.com/users/lemavri/followers","following_url":"https://api.github.com/users/lemavri/following{/other_user}","gists_url":"https://api.github.com/users/lemavri/gists{/gist_id}","starred_url":"https://api.github.com/users/lemavri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemavri/subscriptions","organizations_url":"https://api.github.com/users/lemavri/orgs","repos_url":"https://api.github.com/users/lemavri/repos","events_url":"https://api.github.com/users/lemavri/events{/privacy}","received_events_url":"https://api.github.com/users/lemavri/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2015-07-14T20:01:51Z","updated_at":"2015-07-14T20:03:15Z","due_on":"2015-07-17T03:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/prey/prey-node-client/pulls/139/commits","review_comments_url":"https://api.github.com/repos/prey/prey-node-client/pulls/139/comments","review_comment_url":"https://api.github.com/repos/prey/prey-node-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prey/prey-node-client/issues/139/comments","statuses_url":"https://api.github.com/repos/prey/prey-node-client/statuses/701d9b9db9c1e2e3a88aae35ba4d2bd06ebf377f","head":{"label":"prey:rebased-location","ref":"rebased-location","sha":"701d9b9db9c1e2e3a88aae35ba4d2bd06ebf377f","user":{"login":"prey","id":833975,"avatar_url":"https://avatars.githubusercontent.com/u/833975?v=3","gravatar_id":"","url":"https://api.github.com/users/prey","html_url":"https://github.com/prey","followers_url":"https://api.github.com/users/prey/followers","following_url":"https://api.github.com/users/prey/following{/other_user}","gists_url":"https://api.github.com/users/prey/gists{/gist_id}","starred_url":"https://api.github.com/users/prey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prey/subscriptions","organizations_url":"https://api.github.com/users/prey/orgs","repos_url":"https://api.github.com/users/prey/repos","events_url":"https://api.github.com/users/prey/events{/privacy}","received_events_url":"https://api.github.com/users/prey/received_events","type":"Organization","site_admin":false},"repo":{"id":3743084,"name":"prey-node-client","full_name":"prey/prey-node-client","owner":{"login":"prey","id":833975,"avatar_url":"https://avatars.githubusercontent.com/u/833975?v=3","gravatar_id":"","url":"https://api.github.com/users/prey","html_url":"https://github.com/prey","followers_url":"https://api.github.com/users/prey/followers","following_url":"https://api.github.com/users/prey/following{/other_user}","gists_url":"https://api.github.com/users/prey/gists{/gist_id}","starred_url":"https://api.github.com/users/prey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prey/subscriptions","organizations_url":"https://api.github.com/users/prey/orgs","repos_url":"https://api.github.com/users/prey/repos","events_url":"https://api.github.com/users/prey/events{/privacy}","received_events_url":"https://api.github.com/users/prey/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prey/prey-node-client","description":"Node.js client for the Prey anti-theft software.","fork":false,"url":"https://api.github.com/repos/prey/prey-node-client","forks_url":"https://api.github.com/repos/prey/prey-node-client/forks","keys_url":"https://api.github.com/repos/prey/prey-node-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prey/prey-node-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prey/prey-node-client/teams","hooks_url":"https://api.github.com/repos/prey/prey-node-client/hooks","issue_events_url":"https://api.github.com/repos/prey/prey-node-client/issues/events{/number}","events_url":"https://api.github.com/repos/prey/prey-node-client/events","assignees_url":"https://api.github.com/repos/prey/prey-node-client/assignees{/user}","branches_url":"https://api.github.com/repos/prey/prey-node-client/branches{/branch}","tags_url":"https://api.github.com/repos/prey/prey-node-client/tags","blobs_url":"https://api.github.com/repos/prey/prey-node-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prey/prey-node-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prey/prey-node-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/prey/prey-node-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prey/prey-node-client/statuses/{sha}","languages_url":"https://api.github.com/repos/prey/prey-node-client/languages","stargazers_url":"https://api.github.com/repos/prey/prey-node-client/stargazers","contributors_url":"https://api.github.com/repos/prey/prey-node-client/contributors","subscribers_url":"https://api.github.com/repos/prey/prey-node-client/subscribers","subscription_url":"https://api.github.com/repos/prey/prey-node-client/subscription","commits_url":"https://api.github.com/repos/prey/prey-node-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/prey/prey-node-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/prey/prey-node-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/prey/prey-node-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/prey/prey-node-client/contents/{+path}","compare_url":"https://api.github.com/repos/prey/prey-node-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prey/prey-node-client/merges","archive_url":"https://api.github.com/repos/prey/prey-node-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prey/prey-node-client/downloads","issues_url":"https://api.github.com/repos/prey/prey-node-client/issues{/number}","pulls_url":"https://api.github.com/repos/prey/prey-node-client/pulls{/number}","milestones_url":"https://api.github.com/repos/prey/prey-node-client/milestones{/number}","notifications_url":"https://api.github.com/repos/prey/prey-node-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prey/prey-node-client/labels{/name}","releases_url":"https://api.github.com/repos/prey/prey-node-client/releases{/id}","created_at":"2012-03-16T21:09:27Z","updated_at":"2015-07-01T19:37:38Z","pushed_at":"2015-07-14T21:18:25Z","git_url":"git://github.com/prey/prey-node-client.git","ssh_url":"git@github.com:prey/prey-node-client.git","clone_url":"https://github.com/prey/prey-node-client.git","svn_url":"https://github.com/prey/prey-node-client","homepage":"http://preyproject.com","size":24954,"stargazers_count":162,"watchers_count":162,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":50,"forks":44,"open_issues":50,"watchers":162,"default_branch":"master"}},"base":{"label":"prey:master","ref":"master","sha":"64ca3354cc08105a8ccb0307bae45826515d84e3","user":{"login":"prey","id":833975,"avatar_url":"https://avatars.githubusercontent.com/u/833975?v=3","gravatar_id":"","url":"https://api.github.com/users/prey","html_url":"https://github.com/prey","followers_url":"https://api.github.com/users/prey/followers","following_url":"https://api.github.com/users/prey/following{/other_user}","gists_url":"https://api.github.com/users/prey/gists{/gist_id}","starred_url":"https://api.github.com/users/prey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prey/subscriptions","organizations_url":"https://api.github.com/users/prey/orgs","repos_url":"https://api.github.com/users/prey/repos","events_url":"https://api.github.com/users/prey/events{/privacy}","received_events_url":"https://api.github.com/users/prey/received_events","type":"Organization","site_admin":false},"repo":{"id":3743084,"name":"prey-node-client","full_name":"prey/prey-node-client","owner":{"login":"prey","id":833975,"avatar_url":"https://avatars.githubusercontent.com/u/833975?v=3","gravatar_id":"","url":"https://api.github.com/users/prey","html_url":"https://github.com/prey","followers_url":"https://api.github.com/users/prey/followers","following_url":"https://api.github.com/users/prey/following{/other_user}","gists_url":"https://api.github.com/users/prey/gists{/gist_id}","starred_url":"https://api.github.com/users/prey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prey/subscriptions","organizations_url":"https://api.github.com/users/prey/orgs","repos_url":"https://api.github.com/users/prey/repos","events_url":"https://api.github.com/users/prey/events{/privacy}","received_events_url":"https://api.github.com/users/prey/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prey/prey-node-client","description":"Node.js client for the Prey anti-theft software.","fork":false,"url":"https://api.github.com/repos/prey/prey-node-client","forks_url":"https://api.github.com/repos/prey/prey-node-client/forks","keys_url":"https://api.github.com/repos/prey/prey-node-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prey/prey-node-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prey/prey-node-client/teams","hooks_url":"https://api.github.com/repos/prey/prey-node-client/hooks","issue_events_url":"https://api.github.com/repos/prey/prey-node-client/issues/events{/number}","events_url":"https://api.github.com/repos/prey/prey-node-client/events","assignees_url":"https://api.github.com/repos/prey/prey-node-client/assignees{/user}","branches_url":"https://api.github.com/repos/prey/prey-node-client/branches{/branch}","tags_url":"https://api.github.com/repos/prey/prey-node-client/tags","blobs_url":"https://api.github.com/repos/prey/prey-node-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prey/prey-node-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prey/prey-node-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/prey/prey-node-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prey/prey-node-client/statuses/{sha}","languages_url":"https://api.github.com/repos/prey/prey-node-client/languages","stargazers_url":"https://api.github.com/repos/prey/prey-node-client/stargazers","contributors_url":"https://api.github.com/repos/prey/prey-node-client/contributors","subscribers_url":"https://api.github.com/repos/prey/prey-node-client/subscribers","subscription_url":"https://api.github.com/repos/prey/prey-node-client/subscription","commits_url":"https://api.github.com/repos/prey/prey-node-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/prey/prey-node-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/prey/prey-node-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/prey/prey-node-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/prey/prey-node-client/contents/{+path}","compare_url":"https://api.github.com/repos/prey/prey-node-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prey/prey-node-client/merges","archive_url":"https://api.github.com/repos/prey/prey-node-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prey/prey-node-client/downloads","issues_url":"https://api.github.com/repos/prey/prey-node-client/issues{/number}","pulls_url":"https://api.github.com/repos/prey/prey-node-client/pulls{/number}","milestones_url":"https://api.github.com/repos/prey/prey-node-client/milestones{/number}","notifications_url":"https://api.github.com/repos/prey/prey-node-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prey/prey-node-client/labels{/name}","releases_url":"https://api.github.com/repos/prey/prey-node-client/releases{/id}","created_at":"2012-03-16T21:09:27Z","updated_at":"2015-07-01T19:37:38Z","pushed_at":"2015-07-14T21:18:25Z","git_url":"git://github.com/prey/prey-node-client.git","ssh_url":"git@github.com:prey/prey-node-client.git","clone_url":"https://github.com/prey/prey-node-client.git","svn_url":"https://github.com/prey/prey-node-client","homepage":"http://preyproject.com","size":24954,"stargazers_count":162,"watchers_count":162,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":50,"forks":44,"open_issues":50,"watchers":162,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/139"},"html":{"href":"https://github.com/prey/prey-node-client/pull/139"},"issue":{"href":"https://api.github.com/repos/prey/prey-node-client/issues/139"},"comments":{"href":"https://api.github.com/repos/prey/prey-node-client/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prey/prey-node-client/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/prey/prey-node-client/statuses/701d9b9db9c1e2e3a88aae35ba4d2bd06ebf377f"}}}}