{"action":"created","comment":{"url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/comments/71892057","id":71892057,"diff_hunk":"@@ -9,107 +9,111 @@ var oauth_service = 'audience:server:client_id:848232511240-7so421jotr2609rmqakc\n var app = 'com.nianticlabs.pokemongo';\n var client_sig = '321187995bc7cdc2b5fc91b11a96e2baa8602c62';\n \n-module.exports = {\n-    PokemonClub: function (user, pass, self, callback) {\n-        var options = {\n+\n+var PokemonClub = function (user, pass, self, callback) {\n+    var options = {\n+        url: login_url,\n+        headers: {\n+            'User-Agent': 'niantic'\n+        }\n+    };\n+\n+    self.request.get(options, function (err, response, body) {\n+        if (err) {\n+            return callback(err, null);\n+        }\n+\n+        var data = null;\n+        try {\n+          data = JSON.parse(body);\n+        }catch(err){\n+          return callback(err, null);\n+        }\n+\n+        options = {\n             url: login_url,\n+            form: {\n+                'lt': data.lt,\n+                'execution': data.execution,\n+                '_eventId': 'submit',\n+                'username': user,\n+                'password': pass\n+            },\n             headers: {\n                 'User-Agent': 'niantic'\n             }\n         };\n \n-        self.request.get(options, function (err, response, body) {\n-            var data;\n-\n-            if (err) {\n+        self.request.post(options, function (err, response, body) {\n+            //Parse body if any exists, callback with errors if any.\n+            if(err) {\n                 return callback(err, null);\n             }\n-            \n-            try {\n-              data = JSON.parse(body);\n-            }catch(err){\n-              return callback(err, null);\n+\n+            if (body) {\n+                var parsedBody = JSON.parse(body);","path":"logins.js","position":58,"original_position":58,"commit_id":"01559e8a53f2ce17d305129c91982e4d55180bac","original_commit_id":"01559e8a53f2ce17d305129c91982e4d55180bac","user":{"login":"kapadiamush","id":2934832,"avatar_url":"https://avatars.githubusercontent.com/u/2934832?v=3","gravatar_id":"","url":"https://api.github.com/users/kapadiamush","html_url":"https://github.com/kapadiamush","followers_url":"https://api.github.com/users/kapadiamush/followers","following_url":"https://api.github.com/users/kapadiamush/following{/other_user}","gists_url":"https://api.github.com/users/kapadiamush/gists{/gist_id}","starred_url":"https://api.github.com/users/kapadiamush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapadiamush/subscriptions","organizations_url":"https://api.github.com/users/kapadiamush/orgs","repos_url":"https://api.github.com/users/kapadiamush/repos","events_url":"https://api.github.com/users/kapadiamush/events{/privacy}","received_events_url":"https://api.github.com/users/kapadiamush/received_events","type":"User","site_admin":false},"body":"So I just refactore the code. Didn't actually change anything . Github's diff is off because i pulled out the two objects (`GoogleAccount` and `PokemonClub`) ","created_at":"2016-07-22T14:55:07Z","updated_at":"2016-07-22T14:55:07Z","html_url":"https://github.com/Armax/Pokemon-GO-node-api/pull/86#discussion_r71892057","pull_request_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/comments/71892057"},"html":{"href":"https://github.com/Armax/Pokemon-GO-node-api/pull/86#discussion_r71892057"},"pull_request":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86","id":78489006,"html_url":"https://github.com/Armax/Pokemon-GO-node-api/pull/86","diff_url":"https://github.com/Armax/Pokemon-GO-node-api/pull/86.diff","patch_url":"https://github.com/Armax/Pokemon-GO-node-api/pull/86.patch","issue_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/86","number":86,"state":"open","locked":false,"title":"Minor fixes","user":{"login":"kapadiamush","id":2934832,"avatar_url":"https://avatars.githubusercontent.com/u/2934832?v=3","gravatar_id":"","url":"https://api.github.com/users/kapadiamush","html_url":"https://github.com/kapadiamush","followers_url":"https://api.github.com/users/kapadiamush/followers","following_url":"https://api.github.com/users/kapadiamush/following{/other_user}","gists_url":"https://api.github.com/users/kapadiamush/gists{/gist_id}","starred_url":"https://api.github.com/users/kapadiamush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapadiamush/subscriptions","organizations_url":"https://api.github.com/users/kapadiamush/orgs","repos_url":"https://api.github.com/users/kapadiamush/repos","events_url":"https://api.github.com/users/kapadiamush/events{/privacy}","received_events_url":"https://api.github.com/users/kapadiamush/received_events","type":"User","site_admin":false},"body":"* can simply require json files \r\n\r\n* cleaned up `logins.js`","created_at":"2016-07-22T14:47:06Z","updated_at":"2016-07-22T14:55:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0aeef4a3ec1e4ce97dd981029a5f4193f148fd03","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86/commits","review_comments_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86/comments","review_comment_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/86/comments","statuses_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/statuses/01559e8a53f2ce17d305129c91982e4d55180bac","head":{"label":"kapadiamush:minor-fixes","ref":"minor-fixes","sha":"01559e8a53f2ce17d305129c91982e4d55180bac","user":{"login":"kapadiamush","id":2934832,"avatar_url":"https://avatars.githubusercontent.com/u/2934832?v=3","gravatar_id":"","url":"https://api.github.com/users/kapadiamush","html_url":"https://github.com/kapadiamush","followers_url":"https://api.github.com/users/kapadiamush/followers","following_url":"https://api.github.com/users/kapadiamush/following{/other_user}","gists_url":"https://api.github.com/users/kapadiamush/gists{/gist_id}","starred_url":"https://api.github.com/users/kapadiamush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapadiamush/subscriptions","organizations_url":"https://api.github.com/users/kapadiamush/orgs","repos_url":"https://api.github.com/users/kapadiamush/repos","events_url":"https://api.github.com/users/kapadiamush/events{/privacy}","received_events_url":"https://api.github.com/users/kapadiamush/received_events","type":"User","site_admin":false},"repo":{"id":63884004,"name":"Pokemon-GO-node-api","full_name":"kapadiamush/Pokemon-GO-node-api","owner":{"login":"kapadiamush","id":2934832,"avatar_url":"https://avatars.githubusercontent.com/u/2934832?v=3","gravatar_id":"","url":"https://api.github.com/users/kapadiamush","html_url":"https://github.com/kapadiamush","followers_url":"https://api.github.com/users/kapadiamush/followers","following_url":"https://api.github.com/users/kapadiamush/following{/other_user}","gists_url":"https://api.github.com/users/kapadiamush/gists{/gist_id}","starred_url":"https://api.github.com/users/kapadiamush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapadiamush/subscriptions","organizations_url":"https://api.github.com/users/kapadiamush/orgs","repos_url":"https://api.github.com/users/kapadiamush/repos","events_url":"https://api.github.com/users/kapadiamush/events{/privacy}","received_events_url":"https://api.github.com/users/kapadiamush/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kapadiamush/Pokemon-GO-node-api","description":"Pokemon GO api node.js library","fork":true,"url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api","forks_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/forks","keys_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/teams","hooks_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/hooks","issue_events_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/issues/events{/number}","events_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/events","assignees_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/assignees{/user}","branches_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/branches{/branch}","tags_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/tags","blobs_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/statuses/{sha}","languages_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/languages","stargazers_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/stargazers","contributors_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/contributors","subscribers_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/subscribers","subscription_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/subscription","commits_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/contents/{+path}","compare_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/merges","archive_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/downloads","issues_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/issues{/number}","pulls_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/pulls{/number}","milestones_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/milestones{/number}","notifications_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/labels{/name}","releases_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/releases{/id}","deployments_url":"https://api.github.com/repos/kapadiamush/Pokemon-GO-node-api/deployments","created_at":"2016-07-21T16:10:10Z","updated_at":"2016-07-22T14:21:15Z","pushed_at":"2016-07-22T14:46:00Z","git_url":"git://github.com/kapadiamush/Pokemon-GO-node-api.git","ssh_url":"git@github.com:kapadiamush/Pokemon-GO-node-api.git","clone_url":"https://github.com/kapadiamush/Pokemon-GO-node-api.git","svn_url":"https://github.com/kapadiamush/Pokemon-GO-node-api","homepage":null,"size":76,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"Armax:master","ref":"master","sha":"3991ae1216e0948a8efcea833251bb442be010dd","user":{"login":"Armax","id":1284939,"avatar_url":"https://avatars.githubusercontent.com/u/1284939?v=3","gravatar_id":"","url":"https://api.github.com/users/Armax","html_url":"https://github.com/Armax","followers_url":"https://api.github.com/users/Armax/followers","following_url":"https://api.github.com/users/Armax/following{/other_user}","gists_url":"https://api.github.com/users/Armax/gists{/gist_id}","starred_url":"https://api.github.com/users/Armax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Armax/subscriptions","organizations_url":"https://api.github.com/users/Armax/orgs","repos_url":"https://api.github.com/users/Armax/repos","events_url":"https://api.github.com/users/Armax/events{/privacy}","received_events_url":"https://api.github.com/users/Armax/received_events","type":"User","site_admin":false},"repo":{"id":63460247,"name":"Pokemon-GO-node-api","full_name":"Armax/Pokemon-GO-node-api","owner":{"login":"Armax","id":1284939,"avatar_url":"https://avatars.githubusercontent.com/u/1284939?v=3","gravatar_id":"","url":"https://api.github.com/users/Armax","html_url":"https://github.com/Armax","followers_url":"https://api.github.com/users/Armax/followers","following_url":"https://api.github.com/users/Armax/following{/other_user}","gists_url":"https://api.github.com/users/Armax/gists{/gist_id}","starred_url":"https://api.github.com/users/Armax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Armax/subscriptions","organizations_url":"https://api.github.com/users/Armax/orgs","repos_url":"https://api.github.com/users/Armax/repos","events_url":"https://api.github.com/users/Armax/events{/privacy}","received_events_url":"https://api.github.com/users/Armax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Armax/Pokemon-GO-node-api","description":"Pokemon GO api node.js library","fork":false,"url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api","forks_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/forks","keys_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/teams","hooks_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/hooks","issue_events_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/events{/number}","events_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/events","assignees_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/assignees{/user}","branches_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/branches{/branch}","tags_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/tags","blobs_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/languages","stargazers_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/stargazers","contributors_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/contributors","subscribers_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/subscribers","subscription_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/subscription","commits_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/contents/{+path}","compare_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/merges","archive_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/downloads","issues_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues{/number}","pulls_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/labels{/name}","releases_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/releases{/id}","deployments_url":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/deployments","created_at":"2016-07-16T01:44:33Z","updated_at":"2016-07-22T14:42:37Z","pushed_at":"2016-07-22T14:47:06Z","git_url":"git://github.com/Armax/Pokemon-GO-node-api.git","ssh_url":"git@github.com:Armax/Pokemon-GO-node-api.git","clone_url":"https://github.com/Armax/Pokemon-GO-node-api.git","svn_url":"https://github.com/Armax/Pokemon-GO-node-api","homepage":null,"size":94,"stargazers_count":387,"watchers_count":387,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":18,"forks":81,"open_issues":18,"watchers":387,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86"},"html":{"href":"https://github.com/Armax/Pokemon-GO-node-api/pull/86"},"issue":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/86"},"comments":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/Armax/Pokemon-GO-node-api/statuses/01559e8a53f2ce17d305129c91982e4d55180bac"}}}}
{"actor":{"display_login":"kapadiamush"}}