{"action":"created","comment":{"url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/comments/139183682","pull_request_review_id":63082738,"id":139183682,"diff_hunk":"@@ -1,45 +1,72 @@\n-from hashlib import sha1\n-from time import time\n-import base64\n-import urllib2\n-import urllib\n-import json\n-import hmac\n-\n \"\"\"\n author: Evan Duffield <eduffield@iacquire.com>\n-\n Thank you to iAcquire for sponsoring development of this module.\n+\n+Updated by Bryan Minor, Ph.D.\n+--> Now works for Python 3\n+Supported by envision.ai\n \"\"\"\n \n-follower_wonk_access_id = \"\"\n-follower_wonk_secret_key = \"\"\n+# External libraries\n+from hashlib import sha1\n+from time import time\n+import base64\n+import urllib.request\n+import urllib.parse\n+import urllib.error\n+import json\n+import hmac\n \n+#Initializations\n+follower_wonk_access_id_str = \"member-ZWZkMDVhODItZGYwOS01YWU4LWJmMzAtOWNhM2QxZjQ3MjM1\"\n+follower_wonk_secret_key_str = \"9wwmbjpcugzgaxuljaqnqzwte9dohjwm\"\n \n+#Class for access FollowerWonk API\n class FollowerWonk(object):\n     @staticmethod\n     def social_authority(username):\n         uri = 'https://api.followerwonk.com/social-authority'\n \n         datime = int(time() + 500)\n \n-        s = hmac.new(follower_wonk_secret_key, \"%s\\n%s\" % (follower_wonk_access_id, datime), sha1).digest()\n+\n+        #Add BMM: Trying to binary format correct\n+        keyBin = bytes(follower_wonk_secret_key_str, 'UTF-8')\n+        messageStr = \"%s\\n%s\" % (follower_wonk_access_id_str, datime)\n+        messageBin = bytes(messageStr, 'UTF-8')\n+\n+\n+        s = hmac.new(keyBin, messageBin, sha1).digest()\n         b64 = base64.b64encode(s)\n-        signature = urllib.quote_plus(b64)\n+        signature = urllib.parse.quote_plus(b64)\n+\n+        auth = \"AccessID=%s;Timestamp=%s;Signature=%s;\" % (follower_wonk_access_id_str, datime, signature)\n \n-        auth = \"AccessID=%s;Timestamp=%s;Signature=%s;\" % (follower_wonk_access_id, datime, signature)\n+        req = urllib.request.Request(\"%s?screen_name=%s;%s\" % (uri, username, auth))\n+        r = urllib.request.urlopen(req)\n \n-        req = urllib2.Request(\"%s?screen_name=%s;%s\" % (uri, username, auth))\n-        r = urllib2.urlopen(req)\n+        responseStr = r.read().decode(\"utf-8\")\n+        #print(\"responseStr = \", responseStr)","path":"code-examples/python.py","position":65,"original_position":65,"commit_id":"f19d691b253cacc0260d11cb90a0221906c21e2c","original_commit_id":"b81cfc8ad38e89595dd831691c68dfb0be538a0a","user":{"login":"b4hand","id":708767,"avatar_url":"https://avatars0.githubusercontent.com/u/708767?v=4","gravatar_id":"","url":"https://api.github.com/users/b4hand","html_url":"https://github.com/b4hand","followers_url":"https://api.github.com/users/b4hand/followers","following_url":"https://api.github.com/users/b4hand/following{/other_user}","gists_url":"https://api.github.com/users/b4hand/gists{/gist_id}","starred_url":"https://api.github.com/users/b4hand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b4hand/subscriptions","organizations_url":"https://api.github.com/users/b4hand/orgs","repos_url":"https://api.github.com/users/b4hand/repos","events_url":"https://api.github.com/users/b4hand/events{/privacy}","received_events_url":"https://api.github.com/users/b4hand/received_events","type":"User","site_admin":false},"body":"I would remove these debug commands.","created_at":"2017-09-15T15:45:02Z","updated_at":"2017-09-15T15:49:31Z","html_url":"https://github.com/seomoz/Social-Authority-SDK/pull/8#discussion_r139183682","pull_request_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/comments/139183682"},"html":{"href":"https://github.com/seomoz/Social-Authority-SDK/pull/8#discussion_r139183682"},"pull_request":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8","id":141225714,"html_url":"https://github.com/seomoz/Social-Authority-SDK/pull/8","diff_url":"https://github.com/seomoz/Social-Authority-SDK/pull/8.diff","patch_url":"https://github.com/seomoz/Social-Authority-SDK/pull/8.patch","issue_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/8","number":8,"state":"open","locked":false,"title":"Update to contributed python example","user":{"login":"semifor","id":37519,"avatar_url":"https://avatars1.githubusercontent.com/u/37519?v=4","gravatar_id":"","url":"https://api.github.com/users/semifor","html_url":"https://github.com/semifor","followers_url":"https://api.github.com/users/semifor/followers","following_url":"https://api.github.com/users/semifor/following{/other_user}","gists_url":"https://api.github.com/users/semifor/gists{/gist_id}","starred_url":"https://api.github.com/users/semifor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/semifor/subscriptions","organizations_url":"https://api.github.com/users/semifor/orgs","repos_url":"https://api.github.com/users/semifor/repos","events_url":"https://api.github.com/users/semifor/events{/privacy}","received_events_url":"https://api.github.com/users/semifor/received_events","type":"User","site_admin":false},"body":"Update to user submitted python example via issue #7.\n\nI added the ipymb file and replaced the python.py file with the submitted update. I changed the line endings in the submitted update to Unix to match the existing format in the repository. Otherwise, it's untested.\n\nCloses #7.","created_at":"2017-09-15T04:18:17Z","updated_at":"2017-09-15T15:49:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ce8bfd8e55624688ae5eafdd22d0745f747e5db","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8/commits","review_comments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8/comments","review_comment_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/8/comments","statuses_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/statuses/f19d691b253cacc0260d11cb90a0221906c21e2c","head":{"label":"seomoz:marc/python-contribution","ref":"marc/python-contribution","sha":"f19d691b253cacc0260d11cb90a0221906c21e2c","user":{"login":"seomoz","id":104895,"avatar_url":"https://avatars0.githubusercontent.com/u/104895?v=4","gravatar_id":"","url":"https://api.github.com/users/seomoz","html_url":"https://github.com/seomoz","followers_url":"https://api.github.com/users/seomoz/followers","following_url":"https://api.github.com/users/seomoz/following{/other_user}","gists_url":"https://api.github.com/users/seomoz/gists{/gist_id}","starred_url":"https://api.github.com/users/seomoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seomoz/subscriptions","organizations_url":"https://api.github.com/users/seomoz/orgs","repos_url":"https://api.github.com/users/seomoz/repos","events_url":"https://api.github.com/users/seomoz/events{/privacy}","received_events_url":"https://api.github.com/users/seomoz/received_events","type":"Organization","site_admin":false},"repo":{"id":8889055,"name":"Social-Authority-SDK","full_name":"seomoz/Social-Authority-SDK","owner":{"login":"seomoz","id":104895,"avatar_url":"https://avatars0.githubusercontent.com/u/104895?v=4","gravatar_id":"","url":"https://api.github.com/users/seomoz","html_url":"https://github.com/seomoz","followers_url":"https://api.github.com/users/seomoz/followers","following_url":"https://api.github.com/users/seomoz/following{/other_user}","gists_url":"https://api.github.com/users/seomoz/gists{/gist_id}","starred_url":"https://api.github.com/users/seomoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seomoz/subscriptions","organizations_url":"https://api.github.com/users/seomoz/orgs","repos_url":"https://api.github.com/users/seomoz/repos","events_url":"https://api.github.com/users/seomoz/events{/privacy}","received_events_url":"https://api.github.com/users/seomoz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seomoz/Social-Authority-SDK","description":null,"fork":false,"url":"https://api.github.com/repos/seomoz/Social-Authority-SDK","forks_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/forks","keys_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/teams","hooks_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/hooks","issue_events_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/events{/number}","events_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/events","assignees_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/assignees{/user}","branches_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/branches{/branch}","tags_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/tags","blobs_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/statuses/{sha}","languages_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/languages","stargazers_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/stargazers","contributors_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/contributors","subscribers_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/subscribers","subscription_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/subscription","commits_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/contents/{+path}","compare_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/merges","archive_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/downloads","issues_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues{/number}","pulls_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls{/number}","milestones_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/milestones{/number}","notifications_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/labels{/name}","releases_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/releases{/id}","deployments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/deployments","created_at":"2013-03-19T20:55:32Z","updated_at":"2017-08-12T07:14:11Z","pushed_at":"2017-09-15T15:49:20Z","git_url":"git://github.com/seomoz/Social-Authority-SDK.git","ssh_url":"git@github.com:seomoz/Social-Authority-SDK.git","clone_url":"https://github.com/seomoz/Social-Authority-SDK.git","svn_url":"https://github.com/seomoz/Social-Authority-SDK","homepage":null,"size":59,"stargazers_count":36,"watchers_count":36,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":2,"forks":16,"open_issues":2,"watchers":36,"default_branch":"master"}},"base":{"label":"seomoz:master","ref":"master","sha":"3f7c969763fd2df40b606ac463afd52eec98031a","user":{"login":"seomoz","id":104895,"avatar_url":"https://avatars0.githubusercontent.com/u/104895?v=4","gravatar_id":"","url":"https://api.github.com/users/seomoz","html_url":"https://github.com/seomoz","followers_url":"https://api.github.com/users/seomoz/followers","following_url":"https://api.github.com/users/seomoz/following{/other_user}","gists_url":"https://api.github.com/users/seomoz/gists{/gist_id}","starred_url":"https://api.github.com/users/seomoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seomoz/subscriptions","organizations_url":"https://api.github.com/users/seomoz/orgs","repos_url":"https://api.github.com/users/seomoz/repos","events_url":"https://api.github.com/users/seomoz/events{/privacy}","received_events_url":"https://api.github.com/users/seomoz/received_events","type":"Organization","site_admin":false},"repo":{"id":8889055,"name":"Social-Authority-SDK","full_name":"seomoz/Social-Authority-SDK","owner":{"login":"seomoz","id":104895,"avatar_url":"https://avatars0.githubusercontent.com/u/104895?v=4","gravatar_id":"","url":"https://api.github.com/users/seomoz","html_url":"https://github.com/seomoz","followers_url":"https://api.github.com/users/seomoz/followers","following_url":"https://api.github.com/users/seomoz/following{/other_user}","gists_url":"https://api.github.com/users/seomoz/gists{/gist_id}","starred_url":"https://api.github.com/users/seomoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seomoz/subscriptions","organizations_url":"https://api.github.com/users/seomoz/orgs","repos_url":"https://api.github.com/users/seomoz/repos","events_url":"https://api.github.com/users/seomoz/events{/privacy}","received_events_url":"https://api.github.com/users/seomoz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seomoz/Social-Authority-SDK","description":null,"fork":false,"url":"https://api.github.com/repos/seomoz/Social-Authority-SDK","forks_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/forks","keys_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/teams","hooks_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/hooks","issue_events_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/events{/number}","events_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/events","assignees_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/assignees{/user}","branches_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/branches{/branch}","tags_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/tags","blobs_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/statuses/{sha}","languages_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/languages","stargazers_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/stargazers","contributors_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/contributors","subscribers_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/subscribers","subscription_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/subscription","commits_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/contents/{+path}","compare_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/merges","archive_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/downloads","issues_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues{/number}","pulls_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls{/number}","milestones_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/milestones{/number}","notifications_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/labels{/name}","releases_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/releases{/id}","deployments_url":"https://api.github.com/repos/seomoz/Social-Authority-SDK/deployments","created_at":"2013-03-19T20:55:32Z","updated_at":"2017-08-12T07:14:11Z","pushed_at":"2017-09-15T15:49:20Z","git_url":"git://github.com/seomoz/Social-Authority-SDK.git","ssh_url":"git@github.com:seomoz/Social-Authority-SDK.git","clone_url":"https://github.com/seomoz/Social-Authority-SDK.git","svn_url":"https://github.com/seomoz/Social-Authority-SDK","homepage":null,"size":59,"stargazers_count":36,"watchers_count":36,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":2,"forks":16,"open_issues":2,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8"},"html":{"href":"https://github.com/seomoz/Social-Authority-SDK/pull/8"},"issue":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/8"},"comments":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/seomoz/Social-Authority-SDK/statuses/f19d691b253cacc0260d11cb90a0221906c21e2c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"b4hand"}}