{"action":"created","comment":{"url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/comments/53510048","id":53510048,"diff_hunk":"@@ -249,9 +166,17 @@ def raw_delete(path, headers={})\n       def extract_response_body(response)\n         return {} if response.nil?\n \n-        raise ServiceUnavailableError if response.code == '503'\n+        raise ServiceUnavailableError if response.status == 503\n \n         response.body.nil? ? {} : JSON.parse(response.body)","path":"lib/fitgem/client.rb","position":190,"original_position":190,"commit_id":"6e70f667c7420b03b4b2b4ca2ec43ced838c3b11","original_commit_id":"6e70f667c7420b03b4b2b4ca2ec43ced838c3b11","user":{"login":"proby","id":967248,"avatar_url":"https://avatars.githubusercontent.com/u/967248?v=3","gravatar_id":"","url":"https://api.github.com/users/proby","html_url":"https://github.com/proby","followers_url":"https://api.github.com/users/proby/followers","following_url":"https://api.github.com/users/proby/following{/other_user}","gists_url":"https://api.github.com/users/proby/gists{/gist_id}","starred_url":"https://api.github.com/users/proby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proby/subscriptions","organizations_url":"https://api.github.com/users/proby/orgs","repos_url":"https://api.github.com/users/proby/repos","events_url":"https://api.github.com/users/proby/events{/privacy}","received_events_url":"https://api.github.com/users/proby/received_events","type":"User","site_admin":false},"body":"In some live testing I did a couple days ago I was seeing the Fitbit API returning an empty string in the body, not `nil`. This was causing this line to attempt to `JSON.parse('')` which raises `JSON::ParserError: A JSON text must at least contain two octets!`","created_at":"2016-02-19T19:54:27Z","updated_at":"2016-02-19T19:54:27Z","html_url":"https://github.com/whazzmaster/fitgem/pull/49#discussion_r53510048","pull_request_url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/comments/53510048"},"html":{"href":"https://github.com/whazzmaster/fitgem/pull/49#discussion_r53510048"},"pull_request":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49","id":59099601,"html_url":"https://github.com/whazzmaster/fitgem/pull/49","diff_url":"https://github.com/whazzmaster/fitgem/pull/49.diff","patch_url":"https://github.com/whazzmaster/fitgem/pull/49.patch","issue_url":"https://api.github.com/repos/whazzmaster/fitgem/issues/49","number":49,"state":"open","locked":false,"title":"Basic support for oauth2","user":{"login":"chrisdambrosio","id":1070096,"avatar_url":"https://avatars.githubusercontent.com/u/1070096?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdambrosio","html_url":"https://github.com/chrisdambrosio","followers_url":"https://api.github.com/users/chrisdambrosio/followers","following_url":"https://api.github.com/users/chrisdambrosio/following{/other_user}","gists_url":"https://api.github.com/users/chrisdambrosio/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdambrosio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdambrosio/subscriptions","organizations_url":"https://api.github.com/users/chrisdambrosio/orgs","repos_url":"https://api.github.com/users/chrisdambrosio/repos","events_url":"https://api.github.com/users/chrisdambrosio/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdambrosio/received_events","type":"User","site_admin":false},"body":"This removes oauth code that enables retrieving an access token with a\r\nfitbit generated secret, which is not supported with Fitbit's oauth2\r\nauthentication. This change requires that the access token is generated\r\nand passed to the Fitgem client.\r\n\r\nThis closes #45, and closes #48","created_at":"2016-02-11T21:52:48Z","updated_at":"2016-02-19T19:54:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b107379b73d0c2a9a574024e32829999c379c4e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49/commits","review_comments_url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49/comments","review_comment_url":"https://api.github.com/repos/whazzmaster/fitgem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/whazzmaster/fitgem/issues/49/comments","statuses_url":"https://api.github.com/repos/whazzmaster/fitgem/statuses/6e70f667c7420b03b4b2b4ca2ec43ced838c3b11","head":{"label":"chrisdambrosio:oauth2-support","ref":"oauth2-support","sha":"6e70f667c7420b03b4b2b4ca2ec43ced838c3b11","user":{"login":"chrisdambrosio","id":1070096,"avatar_url":"https://avatars.githubusercontent.com/u/1070096?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdambrosio","html_url":"https://github.com/chrisdambrosio","followers_url":"https://api.github.com/users/chrisdambrosio/followers","following_url":"https://api.github.com/users/chrisdambrosio/following{/other_user}","gists_url":"https://api.github.com/users/chrisdambrosio/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdambrosio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdambrosio/subscriptions","organizations_url":"https://api.github.com/users/chrisdambrosio/orgs","repos_url":"https://api.github.com/users/chrisdambrosio/repos","events_url":"https://api.github.com/users/chrisdambrosio/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdambrosio/received_events","type":"User","site_admin":false},"repo":{"id":51481162,"name":"fitgem","full_name":"chrisdambrosio/fitgem","owner":{"login":"chrisdambrosio","id":1070096,"avatar_url":"https://avatars.githubusercontent.com/u/1070096?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdambrosio","html_url":"https://github.com/chrisdambrosio","followers_url":"https://api.github.com/users/chrisdambrosio/followers","following_url":"https://api.github.com/users/chrisdambrosio/following{/other_user}","gists_url":"https://api.github.com/users/chrisdambrosio/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdambrosio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdambrosio/subscriptions","organizations_url":"https://api.github.com/users/chrisdambrosio/orgs","repos_url":"https://api.github.com/users/chrisdambrosio/repos","events_url":"https://api.github.com/users/chrisdambrosio/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdambrosio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisdambrosio/fitgem","description":"OAuth-based client for the fitbit.com REST API","fork":true,"url":"https://api.github.com/repos/chrisdambrosio/fitgem","forks_url":"https://api.github.com/repos/chrisdambrosio/fitgem/forks","keys_url":"https://api.github.com/repos/chrisdambrosio/fitgem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisdambrosio/fitgem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisdambrosio/fitgem/teams","hooks_url":"https://api.github.com/repos/chrisdambrosio/fitgem/hooks","issue_events_url":"https://api.github.com/repos/chrisdambrosio/fitgem/issues/events{/number}","events_url":"https://api.github.com/repos/chrisdambrosio/fitgem/events","assignees_url":"https://api.github.com/repos/chrisdambrosio/fitgem/assignees{/user}","branches_url":"https://api.github.com/repos/chrisdambrosio/fitgem/branches{/branch}","tags_url":"https://api.github.com/repos/chrisdambrosio/fitgem/tags","blobs_url":"https://api.github.com/repos/chrisdambrosio/fitgem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisdambrosio/fitgem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisdambrosio/fitgem/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisdambrosio/fitgem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisdambrosio/fitgem/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisdambrosio/fitgem/languages","stargazers_url":"https://api.github.com/repos/chrisdambrosio/fitgem/stargazers","contributors_url":"https://api.github.com/repos/chrisdambrosio/fitgem/contributors","subscribers_url":"https://api.github.com/repos/chrisdambrosio/fitgem/subscribers","subscription_url":"https://api.github.com/repos/chrisdambrosio/fitgem/subscription","commits_url":"https://api.github.com/repos/chrisdambrosio/fitgem/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisdambrosio/fitgem/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisdambrosio/fitgem/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisdambrosio/fitgem/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisdambrosio/fitgem/contents/{+path}","compare_url":"https://api.github.com/repos/chrisdambrosio/fitgem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisdambrosio/fitgem/merges","archive_url":"https://api.github.com/repos/chrisdambrosio/fitgem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisdambrosio/fitgem/downloads","issues_url":"https://api.github.com/repos/chrisdambrosio/fitgem/issues{/number}","pulls_url":"https://api.github.com/repos/chrisdambrosio/fitgem/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisdambrosio/fitgem/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisdambrosio/fitgem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisdambrosio/fitgem/labels{/name}","releases_url":"https://api.github.com/repos/chrisdambrosio/fitgem/releases{/id}","deployments_url":"https://api.github.com/repos/chrisdambrosio/fitgem/deployments","created_at":"2016-02-10T23:34:19Z","updated_at":"2016-02-10T23:34:20Z","pushed_at":"2016-02-15T05:27:55Z","git_url":"git://github.com/chrisdambrosio/fitgem.git","ssh_url":"git@github.com:chrisdambrosio/fitgem.git","clone_url":"https://github.com/chrisdambrosio/fitgem.git","svn_url":"https://github.com/chrisdambrosio/fitgem","homepage":"","size":184,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"whazzmaster:master","ref":"master","sha":"e0346405df8af12b1fd55f46d0b1288e713d934d","user":{"login":"whazzmaster","id":102357,"avatar_url":"https://avatars.githubusercontent.com/u/102357?v=3","gravatar_id":"","url":"https://api.github.com/users/whazzmaster","html_url":"https://github.com/whazzmaster","followers_url":"https://api.github.com/users/whazzmaster/followers","following_url":"https://api.github.com/users/whazzmaster/following{/other_user}","gists_url":"https://api.github.com/users/whazzmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/whazzmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whazzmaster/subscriptions","organizations_url":"https://api.github.com/users/whazzmaster/orgs","repos_url":"https://api.github.com/users/whazzmaster/repos","events_url":"https://api.github.com/users/whazzmaster/events{/privacy}","received_events_url":"https://api.github.com/users/whazzmaster/received_events","type":"User","site_admin":false},"repo":{"id":1497179,"name":"fitgem","full_name":"whazzmaster/fitgem","owner":{"login":"whazzmaster","id":102357,"avatar_url":"https://avatars.githubusercontent.com/u/102357?v=3","gravatar_id":"","url":"https://api.github.com/users/whazzmaster","html_url":"https://github.com/whazzmaster","followers_url":"https://api.github.com/users/whazzmaster/followers","following_url":"https://api.github.com/users/whazzmaster/following{/other_user}","gists_url":"https://api.github.com/users/whazzmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/whazzmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whazzmaster/subscriptions","organizations_url":"https://api.github.com/users/whazzmaster/orgs","repos_url":"https://api.github.com/users/whazzmaster/repos","events_url":"https://api.github.com/users/whazzmaster/events{/privacy}","received_events_url":"https://api.github.com/users/whazzmaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whazzmaster/fitgem","description":"OAuth-based client for the fitbit.com REST API","fork":false,"url":"https://api.github.com/repos/whazzmaster/fitgem","forks_url":"https://api.github.com/repos/whazzmaster/fitgem/forks","keys_url":"https://api.github.com/repos/whazzmaster/fitgem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whazzmaster/fitgem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whazzmaster/fitgem/teams","hooks_url":"https://api.github.com/repos/whazzmaster/fitgem/hooks","issue_events_url":"https://api.github.com/repos/whazzmaster/fitgem/issues/events{/number}","events_url":"https://api.github.com/repos/whazzmaster/fitgem/events","assignees_url":"https://api.github.com/repos/whazzmaster/fitgem/assignees{/user}","branches_url":"https://api.github.com/repos/whazzmaster/fitgem/branches{/branch}","tags_url":"https://api.github.com/repos/whazzmaster/fitgem/tags","blobs_url":"https://api.github.com/repos/whazzmaster/fitgem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whazzmaster/fitgem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whazzmaster/fitgem/git/refs{/sha}","trees_url":"https://api.github.com/repos/whazzmaster/fitgem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whazzmaster/fitgem/statuses/{sha}","languages_url":"https://api.github.com/repos/whazzmaster/fitgem/languages","stargazers_url":"https://api.github.com/repos/whazzmaster/fitgem/stargazers","contributors_url":"https://api.github.com/repos/whazzmaster/fitgem/contributors","subscribers_url":"https://api.github.com/repos/whazzmaster/fitgem/subscribers","subscription_url":"https://api.github.com/repos/whazzmaster/fitgem/subscription","commits_url":"https://api.github.com/repos/whazzmaster/fitgem/commits{/sha}","git_commits_url":"https://api.github.com/repos/whazzmaster/fitgem/git/commits{/sha}","comments_url":"https://api.github.com/repos/whazzmaster/fitgem/comments{/number}","issue_comment_url":"https://api.github.com/repos/whazzmaster/fitgem/issues/comments{/number}","contents_url":"https://api.github.com/repos/whazzmaster/fitgem/contents/{+path}","compare_url":"https://api.github.com/repos/whazzmaster/fitgem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whazzmaster/fitgem/merges","archive_url":"https://api.github.com/repos/whazzmaster/fitgem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whazzmaster/fitgem/downloads","issues_url":"https://api.github.com/repos/whazzmaster/fitgem/issues{/number}","pulls_url":"https://api.github.com/repos/whazzmaster/fitgem/pulls{/number}","milestones_url":"https://api.github.com/repos/whazzmaster/fitgem/milestones{/number}","notifications_url":"https://api.github.com/repos/whazzmaster/fitgem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whazzmaster/fitgem/labels{/name}","releases_url":"https://api.github.com/repos/whazzmaster/fitgem/releases{/id}","deployments_url":"https://api.github.com/repos/whazzmaster/fitgem/deployments","created_at":"2011-03-18T17:33:57Z","updated_at":"2016-02-15T18:48:24Z","pushed_at":"2016-02-15T05:27:55Z","git_url":"git://github.com/whazzmaster/fitgem.git","ssh_url":"git@github.com:whazzmaster/fitgem.git","clone_url":"https://github.com/whazzmaster/fitgem.git","svn_url":"https://github.com/whazzmaster/fitgem","homepage":"","size":603,"stargazers_count":178,"watchers_count":178,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":8,"forks":65,"open_issues":8,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49"},"html":{"href":"https://github.com/whazzmaster/fitgem/pull/49"},"issue":{"href":"https://api.github.com/repos/whazzmaster/fitgem/issues/49"},"comments":{"href":"https://api.github.com/repos/whazzmaster/fitgem/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/whazzmaster/fitgem/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/whazzmaster/fitgem/statuses/6e70f667c7420b03b4b2b4ca2ec43ced838c3b11"}}}}