{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cordova-cli/pulls/comments/63066803","id":63066803,"diff_hunk":"@@ -0,0 +1,122 @@\n+/**\n+    Licensed to the Apache Software Foundation (ASF) under one\n+    or more contributor license agreements.  See the NOTICE file\n+    distributed with this work for additional information\n+    regarding copyright ownership.  The ASF licenses this file\n+    to you under the Apache License, Version 2.0 (the\n+    \"License\"); you may not use this file except in compliance\n+    with the License.  You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+    Unless required by applicable law or agreed to in writing,\n+    software distributed under the License is distributed on an\n+    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+    KIND, either express or implied.  See the License for the\n+    specific language governing permissions and limitations\n+    under the License.\n+*/\n+\n+/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,\n+          indent:4, unused:vars, latedef:nofunc,\n+          laxcomma:true\n+*/\n+\n+\n+\n+// For further details on telemetry, see:\n+// https://github.com/cordova/cordova-discuss/pull/43\n+\n+var Q = require('q');\n+\n+// Google Analytics tracking code\n+var GA_TRACKING_CODE = 'UA-64283057-7';\n+\n+var pkg = require('../package.json');\n+var Insight = require('insight');\n+var insight = new Insight({\n+    trackingCode: GA_TRACKING_CODE,\n+    pkg: pkg\n+});\n+\n+/**\n+ * Returns true if the user opted in, and false otherwise\n+ */\n+function showPrompt() {\n+\n+    var deferred = Q.defer();\n+    \n+    var msg = \"May Cordova anonymously report usage statistics to improve the tool over time?\";\n+    insight.askPermission(msg, function (unused, optIn) {\n+        var EOL = require('os').EOL;\n+        if (optIn) {\n+            console.log(EOL + \"Thanks for opting into telemetry to help us improve cordova.\");","path":"src/telemetry.js","position":53,"original_position":53,"commit_id":"dcfb06a60afb7ad56b6090659d4035771e531fcf","original_commit_id":"f5133def71f58890498d4957a8dc26cf86fee6f3","user":{"login":"omefire","id":4992035,"avatar_url":"https://avatars.githubusercontent.com/u/4992035?v=3","gravatar_id":"","url":"https://api.github.com/users/omefire","html_url":"https://github.com/omefire","followers_url":"https://api.github.com/users/omefire/followers","following_url":"https://api.github.com/users/omefire/following{/other_user}","gists_url":"https://api.github.com/users/omefire/gists{/gist_id}","starred_url":"https://api.github.com/users/omefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omefire/subscriptions","organizations_url":"https://api.github.com/users/omefire/orgs","repos_url":"https://api.github.com/users/omefire/repos","events_url":"https://api.github.com/users/omefire/events{/privacy}","received_events_url":"https://api.github.com/users/omefire/received_events","type":"User","site_admin":false},"body":"We can derive this percentage, noo ?","created_at":"2016-05-12T17:57:20Z","updated_at":"2016-05-12T17:57:20Z","html_url":"https://github.com/apache/cordova-cli/pull/247#discussion_r63066803","pull_request_url":"https://api.github.com/repos/apache/cordova-cli/pulls/247","_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/comments/63066803"},"html":{"href":"https://github.com/apache/cordova-cli/pull/247#discussion_r63066803"},"pull_request":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/247"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cordova-cli/pulls/247","id":68618169,"html_url":"https://github.com/apache/cordova-cli/pull/247","diff_url":"https://github.com/apache/cordova-cli/pull/247.diff","patch_url":"https://github.com/apache/cordova-cli/pull/247.patch","issue_url":"https://api.github.com/repos/apache/cordova-cli/issues/247","number":247,"state":"open","locked":false,"title":"Telemetry","user":{"login":"omefire","id":4992035,"avatar_url":"https://avatars.githubusercontent.com/u/4992035?v=3","gravatar_id":"","url":"https://api.github.com/users/omefire","html_url":"https://github.com/omefire","followers_url":"https://api.github.com/users/omefire/followers","following_url":"https://api.github.com/users/omefire/following{/other_user}","gists_url":"https://api.github.com/users/omefire/gists{/gist_id}","starred_url":"https://api.github.com/users/omefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omefire/subscriptions","organizations_url":"https://api.github.com/users/omefire/orgs","repos_url":"https://api.github.com/users/omefire/repos","events_url":"https://api.github.com/users/omefire/events{/privacy}","received_events_url":"https://api.github.com/users/omefire/received_events","type":"User","site_admin":false},"body":"Here is the related proposal: https://github.com/cordova/cordova-discuss/pull/43\r\n","created_at":"2016-05-02T20:43:10Z","updated_at":"2016-05-12T17:57:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f6bf4c5985e013686a80de993ca190666f8584a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cordova-cli/pulls/247/commits","review_comments_url":"https://api.github.com/repos/apache/cordova-cli/pulls/247/comments","review_comment_url":"https://api.github.com/repos/apache/cordova-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cordova-cli/issues/247/comments","statuses_url":"https://api.github.com/repos/apache/cordova-cli/statuses/dcfb06a60afb7ad56b6090659d4035771e531fcf","head":{"label":"omefire:Telemetry","ref":"Telemetry","sha":"dcfb06a60afb7ad56b6090659d4035771e531fcf","user":{"login":"omefire","id":4992035,"avatar_url":"https://avatars.githubusercontent.com/u/4992035?v=3","gravatar_id":"","url":"https://api.github.com/users/omefire","html_url":"https://github.com/omefire","followers_url":"https://api.github.com/users/omefire/followers","following_url":"https://api.github.com/users/omefire/following{/other_user}","gists_url":"https://api.github.com/users/omefire/gists{/gist_id}","starred_url":"https://api.github.com/users/omefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omefire/subscriptions","organizations_url":"https://api.github.com/users/omefire/orgs","repos_url":"https://api.github.com/users/omefire/repos","events_url":"https://api.github.com/users/omefire/events{/privacy}","received_events_url":"https://api.github.com/users/omefire/received_events","type":"User","site_admin":false},"repo":{"id":47293553,"name":"cordova-cli","full_name":"omefire/cordova-cli","owner":{"login":"omefire","id":4992035,"avatar_url":"https://avatars.githubusercontent.com/u/4992035?v=3","gravatar_id":"","url":"https://api.github.com/users/omefire","html_url":"https://github.com/omefire","followers_url":"https://api.github.com/users/omefire/followers","following_url":"https://api.github.com/users/omefire/following{/other_user}","gists_url":"https://api.github.com/users/omefire/gists{/gist_id}","starred_url":"https://api.github.com/users/omefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omefire/subscriptions","organizations_url":"https://api.github.com/users/omefire/orgs","repos_url":"https://api.github.com/users/omefire/repos","events_url":"https://api.github.com/users/omefire/events{/privacy}","received_events_url":"https://api.github.com/users/omefire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omefire/cordova-cli","description":"Mirror of Apache Cordova CLI","fork":true,"url":"https://api.github.com/repos/omefire/cordova-cli","forks_url":"https://api.github.com/repos/omefire/cordova-cli/forks","keys_url":"https://api.github.com/repos/omefire/cordova-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omefire/cordova-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omefire/cordova-cli/teams","hooks_url":"https://api.github.com/repos/omefire/cordova-cli/hooks","issue_events_url":"https://api.github.com/repos/omefire/cordova-cli/issues/events{/number}","events_url":"https://api.github.com/repos/omefire/cordova-cli/events","assignees_url":"https://api.github.com/repos/omefire/cordova-cli/assignees{/user}","branches_url":"https://api.github.com/repos/omefire/cordova-cli/branches{/branch}","tags_url":"https://api.github.com/repos/omefire/cordova-cli/tags","blobs_url":"https://api.github.com/repos/omefire/cordova-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omefire/cordova-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omefire/cordova-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/omefire/cordova-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omefire/cordova-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/omefire/cordova-cli/languages","stargazers_url":"https://api.github.com/repos/omefire/cordova-cli/stargazers","contributors_url":"https://api.github.com/repos/omefire/cordova-cli/contributors","subscribers_url":"https://api.github.com/repos/omefire/cordova-cli/subscribers","subscription_url":"https://api.github.com/repos/omefire/cordova-cli/subscription","commits_url":"https://api.github.com/repos/omefire/cordova-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/omefire/cordova-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/omefire/cordova-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/omefire/cordova-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/omefire/cordova-cli/contents/{+path}","compare_url":"https://api.github.com/repos/omefire/cordova-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omefire/cordova-cli/merges","archive_url":"https://api.github.com/repos/omefire/cordova-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omefire/cordova-cli/downloads","issues_url":"https://api.github.com/repos/omefire/cordova-cli/issues{/number}","pulls_url":"https://api.github.com/repos/omefire/cordova-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/omefire/cordova-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/omefire/cordova-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omefire/cordova-cli/labels{/name}","releases_url":"https://api.github.com/repos/omefire/cordova-cli/releases{/id}","deployments_url":"https://api.github.com/repos/omefire/cordova-cli/deployments","created_at":"2015-12-02T22:54:58Z","updated_at":"2015-12-02T22:55:00Z","pushed_at":"2016-05-12T17:50:42Z","git_url":"git://github.com/omefire/cordova-cli.git","ssh_url":"git@github.com:omefire/cordova-cli.git","clone_url":"https://github.com/omefire/cordova-cli.git","svn_url":"https://github.com/omefire/cordova-cli","homepage":null,"size":39948,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"f0bb9184974ebfad694a8ad735c7568fbf61b759","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":7126418,"name":"cordova-cli","full_name":"apache/cordova-cli","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cordova-cli","description":"Mirror of Apache Cordova CLI","fork":false,"url":"https://api.github.com/repos/apache/cordova-cli","forks_url":"https://api.github.com/repos/apache/cordova-cli/forks","keys_url":"https://api.github.com/repos/apache/cordova-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cordova-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cordova-cli/teams","hooks_url":"https://api.github.com/repos/apache/cordova-cli/hooks","issue_events_url":"https://api.github.com/repos/apache/cordova-cli/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cordova-cli/events","assignees_url":"https://api.github.com/repos/apache/cordova-cli/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cordova-cli/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cordova-cli/tags","blobs_url":"https://api.github.com/repos/apache/cordova-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cordova-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cordova-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cordova-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cordova-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cordova-cli/languages","stargazers_url":"https://api.github.com/repos/apache/cordova-cli/stargazers","contributors_url":"https://api.github.com/repos/apache/cordova-cli/contributors","subscribers_url":"https://api.github.com/repos/apache/cordova-cli/subscribers","subscription_url":"https://api.github.com/repos/apache/cordova-cli/subscription","commits_url":"https://api.github.com/repos/apache/cordova-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cordova-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cordova-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cordova-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cordova-cli/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cordova-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cordova-cli/merges","archive_url":"https://api.github.com/repos/apache/cordova-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cordova-cli/downloads","issues_url":"https://api.github.com/repos/apache/cordova-cli/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cordova-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cordova-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cordova-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cordova-cli/labels{/name}","releases_url":"https://api.github.com/repos/apache/cordova-cli/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cordova-cli/deployments","created_at":"2012-12-12T08:00:28Z","updated_at":"2016-05-06T23:07:40Z","pushed_at":"2016-05-12T17:50:42Z","git_url":"git://github.com/apache/cordova-cli.git","ssh_url":"git@github.com:apache/cordova-cli.git","clone_url":"https://github.com/apache/cordova-cli.git","svn_url":"https://github.com/apache/cordova-cli","homepage":null,"size":45155,"stargazers_count":453,"watchers_count":453,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":243,"mirror_url":"git://git.apache.org/cordova-cli.git","open_issues_count":4,"forks":243,"open_issues":4,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/247"},"html":{"href":"https://github.com/apache/cordova-cli/pull/247"},"issue":{"href":"https://api.github.com/repos/apache/cordova-cli/issues/247"},"comments":{"href":"https://api.github.com/repos/apache/cordova-cli/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cordova-cli/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cordova-cli/statuses/dcfb06a60afb7ad56b6090659d4035771e531fcf"}}}}