{"action":"created","comment":{"url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/comments/57227595","id":57227595,"diff_hunk":"@@ -90,70 +110,58 @@ def authentication_token\n         options.client_options.authentication_token\n       end\n \n-      def get_user_info(token, member_id)\n-        response = Typhoeus.get(\"#{user_info_url}/contactid=#{member_id}/#{token}\")\n-\n-        if response.success?\n-          JSON.parse(response.body)\n-        else\n-          nil\n-        end\n+      def token\n+        access_token[:token]\n       end\n \n-      def is_active_member\n-        return false if member_data[member_columns.find_index('MEMBERTYPE')].nil? ||\n-          member_data[member_columns.find_index('MEMBERTYPE')].downcase == 'null' ||\n-          member_data[member_columns.find_index('PAIDTHRU')].downcase == 'null' ||\n-          !(Date.parse(member_data[member_columns.find_index('PAIDTHRU')]) >= (Date.today - 60.days))\n-        true\n-      end\n+      # Contact Type related methods\n \n-      def member_columns\n-        raw_info['COLUMNS']\n+      def contact_type_data\n+        @contact_type_data ||= fetch_data(contact_type_data_url)\n       end\n \n-      def member_data\n-        @member_data ||= raw_info['DATA'].flatten\n+      def contact_type_data_url\n+        \"#{options.client_options.site}#{options.client_options.contact_type_url}/contactid=#{member_id}/#{token}\"\n       end\n \n-      def member_id\n-        request.params['memberID']\n-      end\n+      # Meeting Attendance related methods\n \n-      def member_type\n-        member_data[member_columns.find_index('MEMBERTYPE')]\n+      def meeting_attendance_data\n+        @meeting_attendance_data ||= fetch_data(meeting_attendance_data_url)\n       end\n \n-      def password\n-        options.client_options.password\n+      def meeting_attendance_data_url\n+        \"#{options.client_options.site}#{options.client_options.meeting_info_url}/contactid=#{member_id}/#{token}\"\n       end\n \n-      def trim_whitespaces(data)\n-        data.strip\n-      end\n+      # User related methods\n \n-      def svu_client?\n-        options.client_options.account_id.to_i == options.client_options.svu_account_id.to_i\n+      def user_data\n+        @user_data ||= fetch_user_data\n       end\n \n-      def svu_custom_params\n-        { ardms_number: user_ardms_number, cci_number: user_cci_number }\n+      def user_data_url\n+        \"#{options.client_options.site}#{options.client_options.user_info_url}/contactid=#{member_id}/#{token}\"\n       end\n \n-      def username\n-        options.client_options.username\n+      def is_active_member\n+        return false if user_data[:membertype].nil? ||\n+          user_data[:membertype].downcase == 'null' ||\n+          user_data[:paidthru].downcase == 'null' ||\n+          !(Date.parse(user_data[:paidthru]) >= (Date.today - 60.days))\n+        true\n       end\n \n-      def user_info_url\n-        \"#{options.client_options.site}#{options.client_options.user_info_url}\"\n+      def member_id\n+        request.params['memberID']\n       end\n \n-      def user_ardms_number\n-        member_data[member_columns.find_index('C_USER_ARDMS')]\n+      def svu_client?\n+        options.client_options.account_id.to_i == options.client_options.svu_account_id.to_i\n       end\n \n-      def user_cci_number\n-        member_data[member_columns.find_index('C_USER_CCI')]\n+      def svu_custom_params\n+        { ardms_number: user_data[:c_user_ardms], cci_number: user_data[:c_user_ardms] }","path":"lib/omniauth/strategies/i4a.rb","position":215,"original_position":215,"commit_id":"680b2b52cf829f03f4f909dd86c136c76d64b9d9","original_commit_id":"680b2b52cf829f03f4f909dd86c136c76d64b9d9","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long. [88/80]","created_at":"2016-03-23T20:07:09Z","updated_at":"2016-03-23T20:07:09Z","html_url":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10#discussion_r57227595","pull_request_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/comments/57227595"},"html":{"href":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10#discussion_r57227595"},"pull_request":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10","id":63944520,"html_url":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10","diff_url":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10.diff","patch_url":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10.patch","issue_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/10","number":10,"state":"open","locked":false,"title":"Integrate additional I4A services to retrieve contact and meeting data.","user":{"login":"davesloan","id":448376,"avatar_url":"https://avatars.githubusercontent.com/u/448376?v=3","gravatar_id":"","url":"https://api.github.com/users/davesloan","html_url":"https://github.com/davesloan","followers_url":"https://api.github.com/users/davesloan/followers","following_url":"https://api.github.com/users/davesloan/following{/other_user}","gists_url":"https://api.github.com/users/davesloan/gists{/gist_id}","starred_url":"https://api.github.com/users/davesloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davesloan/subscriptions","organizations_url":"https://api.github.com/users/davesloan/orgs","repos_url":"https://api.github.com/users/davesloan/repos","events_url":"https://api.github.com/users/davesloan/events{/privacy}","received_events_url":"https://api.github.com/users/davesloan/received_events","type":"User","site_admin":false},"body":"https://trello.com/c/IcJsNYjD","created_at":"2016-03-23T20:06:59Z","updated_at":"2016-03-23T20:07:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27e882da3215e00edd6aaf1ce33f65db9c41bd0f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10/commits","review_comments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10/comments","review_comment_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/10/comments","statuses_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/statuses/680b2b52cf829f03f4f909dd86c136c76d64b9d9","head":{"label":"blueskybroadcast:ds-integrate-credits","ref":"ds-integrate-credits","sha":"680b2b52cf829f03f4f909dd86c136c76d64b9d9","user":{"login":"blueskybroadcast","id":4744696,"avatar_url":"https://avatars.githubusercontent.com/u/4744696?v=3","gravatar_id":"","url":"https://api.github.com/users/blueskybroadcast","html_url":"https://github.com/blueskybroadcast","followers_url":"https://api.github.com/users/blueskybroadcast/followers","following_url":"https://api.github.com/users/blueskybroadcast/following{/other_user}","gists_url":"https://api.github.com/users/blueskybroadcast/gists{/gist_id}","starred_url":"https://api.github.com/users/blueskybroadcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueskybroadcast/subscriptions","organizations_url":"https://api.github.com/users/blueskybroadcast/orgs","repos_url":"https://api.github.com/users/blueskybroadcast/repos","events_url":"https://api.github.com/users/blueskybroadcast/events{/privacy}","received_events_url":"https://api.github.com/users/blueskybroadcast/received_events","type":"Organization","site_admin":false},"repo":{"id":23135799,"name":"omniauth-i4a","full_name":"blueskybroadcast/omniauth-i4a","owner":{"login":"blueskybroadcast","id":4744696,"avatar_url":"https://avatars.githubusercontent.com/u/4744696?v=3","gravatar_id":"","url":"https://api.github.com/users/blueskybroadcast","html_url":"https://github.com/blueskybroadcast","followers_url":"https://api.github.com/users/blueskybroadcast/followers","following_url":"https://api.github.com/users/blueskybroadcast/following{/other_user}","gists_url":"https://api.github.com/users/blueskybroadcast/gists{/gist_id}","starred_url":"https://api.github.com/users/blueskybroadcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueskybroadcast/subscriptions","organizations_url":"https://api.github.com/users/blueskybroadcast/orgs","repos_url":"https://api.github.com/users/blueskybroadcast/repos","events_url":"https://api.github.com/users/blueskybroadcast/events{/privacy}","received_events_url":"https://api.github.com/users/blueskybroadcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blueskybroadcast/omniauth-i4a","description":"","fork":false,"url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a","forks_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/forks","keys_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/teams","hooks_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/hooks","issue_events_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/events{/number}","events_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/events","assignees_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/assignees{/user}","branches_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/branches{/branch}","tags_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/tags","blobs_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/statuses/{sha}","languages_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/languages","stargazers_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/stargazers","contributors_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/contributors","subscribers_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/subscribers","subscription_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/subscription","commits_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/comments{/number}","contents_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/contents/{+path}","compare_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/merges","archive_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/downloads","issues_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues{/number}","pulls_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls{/number}","milestones_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/milestones{/number}","notifications_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/labels{/name}","releases_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/releases{/id}","deployments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/deployments","created_at":"2014-08-20T04:28:12Z","updated_at":"2014-12-31T00:26:15Z","pushed_at":"2016-03-23T20:07:00Z","git_url":"git://github.com/blueskybroadcast/omniauth-i4a.git","ssh_url":"git@github.com:blueskybroadcast/omniauth-i4a.git","clone_url":"https://github.com/blueskybroadcast/omniauth-i4a.git","svn_url":"https://github.com/blueskybroadcast/omniauth-i4a","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"blueskybroadcast:master","ref":"master","sha":"430c1828f3f1aa75bb8e9167a5d942c469676340","user":{"login":"blueskybroadcast","id":4744696,"avatar_url":"https://avatars.githubusercontent.com/u/4744696?v=3","gravatar_id":"","url":"https://api.github.com/users/blueskybroadcast","html_url":"https://github.com/blueskybroadcast","followers_url":"https://api.github.com/users/blueskybroadcast/followers","following_url":"https://api.github.com/users/blueskybroadcast/following{/other_user}","gists_url":"https://api.github.com/users/blueskybroadcast/gists{/gist_id}","starred_url":"https://api.github.com/users/blueskybroadcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueskybroadcast/subscriptions","organizations_url":"https://api.github.com/users/blueskybroadcast/orgs","repos_url":"https://api.github.com/users/blueskybroadcast/repos","events_url":"https://api.github.com/users/blueskybroadcast/events{/privacy}","received_events_url":"https://api.github.com/users/blueskybroadcast/received_events","type":"Organization","site_admin":false},"repo":{"id":23135799,"name":"omniauth-i4a","full_name":"blueskybroadcast/omniauth-i4a","owner":{"login":"blueskybroadcast","id":4744696,"avatar_url":"https://avatars.githubusercontent.com/u/4744696?v=3","gravatar_id":"","url":"https://api.github.com/users/blueskybroadcast","html_url":"https://github.com/blueskybroadcast","followers_url":"https://api.github.com/users/blueskybroadcast/followers","following_url":"https://api.github.com/users/blueskybroadcast/following{/other_user}","gists_url":"https://api.github.com/users/blueskybroadcast/gists{/gist_id}","starred_url":"https://api.github.com/users/blueskybroadcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueskybroadcast/subscriptions","organizations_url":"https://api.github.com/users/blueskybroadcast/orgs","repos_url":"https://api.github.com/users/blueskybroadcast/repos","events_url":"https://api.github.com/users/blueskybroadcast/events{/privacy}","received_events_url":"https://api.github.com/users/blueskybroadcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blueskybroadcast/omniauth-i4a","description":"","fork":false,"url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a","forks_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/forks","keys_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/teams","hooks_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/hooks","issue_events_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/events{/number}","events_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/events","assignees_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/assignees{/user}","branches_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/branches{/branch}","tags_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/tags","blobs_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/statuses/{sha}","languages_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/languages","stargazers_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/stargazers","contributors_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/contributors","subscribers_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/subscribers","subscription_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/subscription","commits_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/comments{/number}","contents_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/contents/{+path}","compare_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/merges","archive_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/downloads","issues_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues{/number}","pulls_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls{/number}","milestones_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/milestones{/number}","notifications_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/labels{/name}","releases_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/releases{/id}","deployments_url":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/deployments","created_at":"2014-08-20T04:28:12Z","updated_at":"2014-12-31T00:26:15Z","pushed_at":"2016-03-23T20:07:00Z","git_url":"git://github.com/blueskybroadcast/omniauth-i4a.git","ssh_url":"git@github.com:blueskybroadcast/omniauth-i4a.git","clone_url":"https://github.com/blueskybroadcast/omniauth-i4a.git","svn_url":"https://github.com/blueskybroadcast/omniauth-i4a","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10"},"html":{"href":"https://github.com/blueskybroadcast/omniauth-i4a/pull/10"},"issue":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/10"},"comments":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/blueskybroadcast/omniauth-i4a/statuses/680b2b52cf829f03f4f909dd86c136c76d64b9d9"}}}}