{"action":"created","comment":{"url":"https://api.github.com/repos/6fusion/api-tools/pulls/comments/55580314","id":55580314,"diff_hunk":"@@ -1,98 +0,0 @@\n-import requests\n-import csv\n-import logging\n-logging.basicConfig(filename='example.log',level=logging.DEBUG)\n-from oauthlib.oauth2 import LegacyApplicationClient\n-from requests_oauthlib import OAuth2Session\n-\n-class MeterHealth:\n-    # Change the values here to match your user and your API credentials\n-    CLIENT_ID = 'WRITE YOUR API CLIENT ID HERE'\n-    CLIENT_SECRET = 'WRITE YOUR API CLIENT SECRET HERE'\n-    USERNAME = 'WRITE YOUR USERNAME HERE'\n-    PASSWORD = 'WRITE YOUR PASSWORD HERE'\n-    SCOPE = ['admin_organization']\n-\n-    # URL information for the API. ONLY change this method if you know what you are doing\n-    BASE_URL = \"http://54.90.173.204:8080\"\n-    ORGANIZATIONS =\"/api/v2.json\"\n-    METERS = \"/api/v2/organizations/%d/meters.json\"\n-    TOKEN_URL = \"/oauth/token\"\n-\n-    def __init__(self):\n-        self.token = self.retrieve_token()\n-        self.payload = {'access_token': self.token}\n-\n-    # create_report: is the main method that calls\n-    # all that need to be done:\n-    # 1. retrieve organizations\n-    # 2. iterate over the organizations to get meters\n-    # 3. create the csv file\n-    def create_report(self):\n-        if self.token:\n-            organizations = self.retrieve_organizations()\n-            if organizations:\n-                total_org = len(organizations)\n-                organization_index = 1\n-                print(\"We found %d organizations \\n\" % total_org)","path":"meter-health/meter_health.py","position":37,"original_position":37,"commit_id":"8d01822274224e94402e661a4438eb9e7b1d6201","original_commit_id":"8d01822274224e94402e661a4438eb9e7b1d6201","user":{"login":"meryH","id":7833154,"avatar_url":"https://avatars.githubusercontent.com/u/7833154?v=3","gravatar_id":"","url":"https://api.github.com/users/meryH","html_url":"https://github.com/meryH","followers_url":"https://api.github.com/users/meryH/followers","following_url":"https://api.github.com/users/meryH/following{/other_user}","gists_url":"https://api.github.com/users/meryH/gists{/gist_id}","starred_url":"https://api.github.com/users/meryH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meryH/subscriptions","organizations_url":"https://api.github.com/users/meryH/orgs","repos_url":"https://api.github.com/users/meryH/repos","events_url":"https://api.github.com/users/meryH/events{/privacy}","received_events_url":"https://api.github.com/users/meryH/received_events","type":"User","site_admin":false},"body":"For interpolation in strings is better to use .format() function, for example:\r\n\"We found {0} organizations\".format(total_org)\r\n\r\n% is an old way to format a string.","created_at":"2016-03-09T20:05:34Z","updated_at":"2016-03-09T20:05:34Z","html_url":"https://github.com/6fusion/api-tools/pull/1#discussion_r55580314","pull_request_url":"https://api.github.com/repos/6fusion/api-tools/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/6fusion/api-tools/pulls/comments/55580314"},"html":{"href":"https://github.com/6fusion/api-tools/pull/1#discussion_r55580314"},"pull_request":{"href":"https://api.github.com/repos/6fusion/api-tools/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/6fusion/api-tools/pulls/1","id":62270042,"html_url":"https://github.com/6fusion/api-tools/pull/1","diff_url":"https://github.com/6fusion/api-tools/pull/1.diff","patch_url":"https://github.com/6fusion/api-tools/pull/1.patch","issue_url":"https://api.github.com/repos/6fusion/api-tools/issues/1","number":1,"state":"open","locked":false,"title":"Base script for health meter check","user":{"login":"fernandacoto","id":4039322,"avatar_url":"https://avatars.githubusercontent.com/u/4039322?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandacoto","html_url":"https://github.com/fernandacoto","followers_url":"https://api.github.com/users/fernandacoto/followers","following_url":"https://api.github.com/users/fernandacoto/following{/other_user}","gists_url":"https://api.github.com/users/fernandacoto/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandacoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandacoto/subscriptions","organizations_url":"https://api.github.com/users/fernandacoto/orgs","repos_url":"https://api.github.com/users/fernandacoto/repos","events_url":"https://api.github.com/users/fernandacoto/events{/privacy}","received_events_url":"https://api.github.com/users/fernandacoto/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-09T18:02:55Z","updated_at":"2016-03-09T20:05:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf7eaf883e02b691a11f5076e671953c17fbe722","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/6fusion/api-tools/pulls/1/commits","review_comments_url":"https://api.github.com/repos/6fusion/api-tools/pulls/1/comments","review_comment_url":"https://api.github.com/repos/6fusion/api-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/6fusion/api-tools/issues/1/comments","statuses_url":"https://api.github.com/repos/6fusion/api-tools/statuses/8d01822274224e94402e661a4438eb9e7b1d6201","head":{"label":"6fusion:move-credentials","ref":"move-credentials","sha":"8d01822274224e94402e661a4438eb9e7b1d6201","user":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"repo":{"id":53340968,"name":"api-tools","full_name":"6fusion/api-tools","owner":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/6fusion/api-tools","description":"","fork":false,"url":"https://api.github.com/repos/6fusion/api-tools","forks_url":"https://api.github.com/repos/6fusion/api-tools/forks","keys_url":"https://api.github.com/repos/6fusion/api-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/6fusion/api-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/6fusion/api-tools/teams","hooks_url":"https://api.github.com/repos/6fusion/api-tools/hooks","issue_events_url":"https://api.github.com/repos/6fusion/api-tools/issues/events{/number}","events_url":"https://api.github.com/repos/6fusion/api-tools/events","assignees_url":"https://api.github.com/repos/6fusion/api-tools/assignees{/user}","branches_url":"https://api.github.com/repos/6fusion/api-tools/branches{/branch}","tags_url":"https://api.github.com/repos/6fusion/api-tools/tags","blobs_url":"https://api.github.com/repos/6fusion/api-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/6fusion/api-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/6fusion/api-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/6fusion/api-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/6fusion/api-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/6fusion/api-tools/languages","stargazers_url":"https://api.github.com/repos/6fusion/api-tools/stargazers","contributors_url":"https://api.github.com/repos/6fusion/api-tools/contributors","subscribers_url":"https://api.github.com/repos/6fusion/api-tools/subscribers","subscription_url":"https://api.github.com/repos/6fusion/api-tools/subscription","commits_url":"https://api.github.com/repos/6fusion/api-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/6fusion/api-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/6fusion/api-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/6fusion/api-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/6fusion/api-tools/contents/{+path}","compare_url":"https://api.github.com/repos/6fusion/api-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/6fusion/api-tools/merges","archive_url":"https://api.github.com/repos/6fusion/api-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/6fusion/api-tools/downloads","issues_url":"https://api.github.com/repos/6fusion/api-tools/issues{/number}","pulls_url":"https://api.github.com/repos/6fusion/api-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/6fusion/api-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/6fusion/api-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/6fusion/api-tools/labels{/name}","releases_url":"https://api.github.com/repos/6fusion/api-tools/releases{/id}","deployments_url":"https://api.github.com/repos/6fusion/api-tools/deployments","created_at":"2016-03-07T16:36:14Z","updated_at":"2016-03-08T17:33:06Z","pushed_at":"2016-03-09T19:25:57Z","git_url":"git://github.com/6fusion/api-tools.git","ssh_url":"git@github.com:6fusion/api-tools.git","clone_url":"https://github.com/6fusion/api-tools.git","svn_url":"https://github.com/6fusion/api-tools","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"6fusion:develop","ref":"develop","sha":"55d8e1bd8a440a1496c5368cae95c59873ffa132","user":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"repo":{"id":53340968,"name":"api-tools","full_name":"6fusion/api-tools","owner":{"login":"6fusion","id":1864001,"avatar_url":"https://avatars.githubusercontent.com/u/1864001?v=3","gravatar_id":"","url":"https://api.github.com/users/6fusion","html_url":"https://github.com/6fusion","followers_url":"https://api.github.com/users/6fusion/followers","following_url":"https://api.github.com/users/6fusion/following{/other_user}","gists_url":"https://api.github.com/users/6fusion/gists{/gist_id}","starred_url":"https://api.github.com/users/6fusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6fusion/subscriptions","organizations_url":"https://api.github.com/users/6fusion/orgs","repos_url":"https://api.github.com/users/6fusion/repos","events_url":"https://api.github.com/users/6fusion/events{/privacy}","received_events_url":"https://api.github.com/users/6fusion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/6fusion/api-tools","description":"","fork":false,"url":"https://api.github.com/repos/6fusion/api-tools","forks_url":"https://api.github.com/repos/6fusion/api-tools/forks","keys_url":"https://api.github.com/repos/6fusion/api-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/6fusion/api-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/6fusion/api-tools/teams","hooks_url":"https://api.github.com/repos/6fusion/api-tools/hooks","issue_events_url":"https://api.github.com/repos/6fusion/api-tools/issues/events{/number}","events_url":"https://api.github.com/repos/6fusion/api-tools/events","assignees_url":"https://api.github.com/repos/6fusion/api-tools/assignees{/user}","branches_url":"https://api.github.com/repos/6fusion/api-tools/branches{/branch}","tags_url":"https://api.github.com/repos/6fusion/api-tools/tags","blobs_url":"https://api.github.com/repos/6fusion/api-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/6fusion/api-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/6fusion/api-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/6fusion/api-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/6fusion/api-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/6fusion/api-tools/languages","stargazers_url":"https://api.github.com/repos/6fusion/api-tools/stargazers","contributors_url":"https://api.github.com/repos/6fusion/api-tools/contributors","subscribers_url":"https://api.github.com/repos/6fusion/api-tools/subscribers","subscription_url":"https://api.github.com/repos/6fusion/api-tools/subscription","commits_url":"https://api.github.com/repos/6fusion/api-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/6fusion/api-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/6fusion/api-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/6fusion/api-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/6fusion/api-tools/contents/{+path}","compare_url":"https://api.github.com/repos/6fusion/api-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/6fusion/api-tools/merges","archive_url":"https://api.github.com/repos/6fusion/api-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/6fusion/api-tools/downloads","issues_url":"https://api.github.com/repos/6fusion/api-tools/issues{/number}","pulls_url":"https://api.github.com/repos/6fusion/api-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/6fusion/api-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/6fusion/api-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/6fusion/api-tools/labels{/name}","releases_url":"https://api.github.com/repos/6fusion/api-tools/releases{/id}","deployments_url":"https://api.github.com/repos/6fusion/api-tools/deployments","created_at":"2016-03-07T16:36:14Z","updated_at":"2016-03-08T17:33:06Z","pushed_at":"2016-03-09T19:25:57Z","git_url":"git://github.com/6fusion/api-tools.git","ssh_url":"git@github.com:6fusion/api-tools.git","clone_url":"https://github.com/6fusion/api-tools.git","svn_url":"https://github.com/6fusion/api-tools","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"Python","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/6fusion/api-tools/pulls/1"},"html":{"href":"https://github.com/6fusion/api-tools/pull/1"},"issue":{"href":"https://api.github.com/repos/6fusion/api-tools/issues/1"},"comments":{"href":"https://api.github.com/repos/6fusion/api-tools/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/6fusion/api-tools/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/6fusion/api-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/6fusion/api-tools/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/6fusion/api-tools/statuses/8d01822274224e94402e661a4438eb9e7b1d6201"}}}}