{"action":"created","comment":{"url":"https://api.github.com/repos/jxtech/wechatpy/pulls/comments/217295357","pull_request_review_id":154970737,"id":217295357,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzI5NTM1Nw==","diff_hunk":"@@ -62,6 +62,38 @@ def get_followers(self, first_user_id=None):\n             params=params\n         )\n \n+    def iter_followers(self):\n+        \"\"\"\n+        获取所有的用户openid列表\n+\n+        详情请参考\n+        https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840\n+\n+        :return: 返回一个迭代器，可以用for进行循环，得到openid\n+\n+        使用示例::\n+\n+            from wechatpy import WeChatClient\n+\n+            client = WeChatClient('appid', 'secret')\n+            for openid in client.user.get_followers():\n+                print(openid)\n+\n+        \"\"\"\n+        while True:\n+            first_user_id = getattr(self, \"_current_iter_openid\", None)","path":"wechatpy/client/api/user.py","position":null,"original_position":32,"commit_id":"68c7ca84d32747c73b03f6bfdfdfd9ce2bf69f8d","original_commit_id":"76512071c31330bda5c904c048bdd0a302055ae0","user":{"login":"ramwin","id":17930851,"node_id":"MDQ6VXNlcjE3OTMwODUx","avatar_url":"https://avatars3.githubusercontent.com/u/17930851?v=4","gravatar_id":"","url":"https://api.github.com/users/ramwin","html_url":"https://github.com/ramwin","followers_url":"https://api.github.com/users/ramwin/followers","following_url":"https://api.github.com/users/ramwin/following{/other_user}","gists_url":"https://api.github.com/users/ramwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramwin/subscriptions","organizations_url":"https://api.github.com/users/ramwin/orgs","repos_url":"https://api.github.com/users/ramwin/repos","events_url":"https://api.github.com/users/ramwin/events{/privacy}","received_events_url":"https://api.github.com/users/ramwin/received_events","type":"User","site_admin":false},"body":"恩，这么写很棒。谢谢指导","created_at":"2018-09-13T08:10:51Z","updated_at":"2018-09-13T08:10:51Z","html_url":"https://github.com/jxtech/wechatpy/pull/387#discussion_r217295357","pull_request_url":"https://api.github.com/repos/jxtech/wechatpy/pulls/387","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/comments/217295357"},"html":{"href":"https://github.com/jxtech/wechatpy/pull/387#discussion_r217295357"},"pull_request":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/387"}},"in_reply_to_id":216942765},"pull_request":{"url":"https://api.github.com/repos/jxtech/wechatpy/pulls/387","id":214872525,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0ODcyNTI1","html_url":"https://github.com/jxtech/wechatpy/pull/387","diff_url":"https://github.com/jxtech/wechatpy/pull/387.diff","patch_url":"https://github.com/jxtech/wechatpy/pull/387.patch","issue_url":"https://api.github.com/repos/jxtech/wechatpy/issues/387","number":387,"state":"open","locked":false,"title":"新功能: 获取所有用户的openid","user":{"login":"ramwin","id":17930851,"node_id":"MDQ6VXNlcjE3OTMwODUx","avatar_url":"https://avatars3.githubusercontent.com/u/17930851?v=4","gravatar_id":"","url":"https://api.github.com/users/ramwin","html_url":"https://github.com/ramwin","followers_url":"https://api.github.com/users/ramwin/followers","following_url":"https://api.github.com/users/ramwin/following{/other_user}","gists_url":"https://api.github.com/users/ramwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramwin/subscriptions","organizations_url":"https://api.github.com/users/ramwin/orgs","repos_url":"https://api.github.com/users/ramwin/repos","events_url":"https://api.github.com/users/ramwin/events{/privacy}","received_events_url":"https://api.github.com/users/ramwin/received_events","type":"User","site_admin":false},"body":"[微信文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840):\r\n> 公众号可通过本接口来获取帐号的关注者列表，关注者列表由一串OpenID（加密后的微信号，每个用户对每个公众号的OpenID是唯一的）组成。一次拉取调用最多拉取10000个关注者的OpenID，可以通过多次拉取的方式来满足需求。\r\n\r\n\r\n所以在调用原来的`wechatpy.client.api.WeChatUser.get_followers`的时候，如果关注者超过10000个，就会返回数据不全的状况。为了方便使用，我创建了一个`wechatpy.client.api.WeChatUser.iter_followers`函数，可以用来迭代关注者的用户openid","created_at":"2018-09-12T08:16:08Z","updated_at":"2018-09-13T08:10:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a79ecb6dda7651a513c6c7d2fa445d71f5e27625","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jxtech/wechatpy/pulls/387/commits","review_comments_url":"https://api.github.com/repos/jxtech/wechatpy/pulls/387/comments","review_comment_url":"https://api.github.com/repos/jxtech/wechatpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jxtech/wechatpy/issues/387/comments","statuses_url":"https://api.github.com/repos/jxtech/wechatpy/statuses/68c7ca84d32747c73b03f6bfdfdfd9ce2bf69f8d","head":{"label":"ramwin:master","ref":"master","sha":"68c7ca84d32747c73b03f6bfdfdfd9ce2bf69f8d","user":{"login":"ramwin","id":17930851,"node_id":"MDQ6VXNlcjE3OTMwODUx","avatar_url":"https://avatars3.githubusercontent.com/u/17930851?v=4","gravatar_id":"","url":"https://api.github.com/users/ramwin","html_url":"https://github.com/ramwin","followers_url":"https://api.github.com/users/ramwin/followers","following_url":"https://api.github.com/users/ramwin/following{/other_user}","gists_url":"https://api.github.com/users/ramwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramwin/subscriptions","organizations_url":"https://api.github.com/users/ramwin/orgs","repos_url":"https://api.github.com/users/ramwin/repos","events_url":"https://api.github.com/users/ramwin/events{/privacy}","received_events_url":"https://api.github.com/users/ramwin/received_events","type":"User","site_admin":false},"repo":{"id":148441432,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg0NDE0MzI=","name":"wechatpy","full_name":"ramwin/wechatpy","owner":{"login":"ramwin","id":17930851,"node_id":"MDQ6VXNlcjE3OTMwODUx","avatar_url":"https://avatars3.githubusercontent.com/u/17930851?v=4","gravatar_id":"","url":"https://api.github.com/users/ramwin","html_url":"https://github.com/ramwin","followers_url":"https://api.github.com/users/ramwin/followers","following_url":"https://api.github.com/users/ramwin/following{/other_user}","gists_url":"https://api.github.com/users/ramwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramwin/subscriptions","organizations_url":"https://api.github.com/users/ramwin/orgs","repos_url":"https://api.github.com/users/ramwin/repos","events_url":"https://api.github.com/users/ramwin/events{/privacy}","received_events_url":"https://api.github.com/users/ramwin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ramwin/wechatpy","description":"WeChat SDK for Python","fork":true,"url":"https://api.github.com/repos/ramwin/wechatpy","forks_url":"https://api.github.com/repos/ramwin/wechatpy/forks","keys_url":"https://api.github.com/repos/ramwin/wechatpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ramwin/wechatpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ramwin/wechatpy/teams","hooks_url":"https://api.github.com/repos/ramwin/wechatpy/hooks","issue_events_url":"https://api.github.com/repos/ramwin/wechatpy/issues/events{/number}","events_url":"https://api.github.com/repos/ramwin/wechatpy/events","assignees_url":"https://api.github.com/repos/ramwin/wechatpy/assignees{/user}","branches_url":"https://api.github.com/repos/ramwin/wechatpy/branches{/branch}","tags_url":"https://api.github.com/repos/ramwin/wechatpy/tags","blobs_url":"https://api.github.com/repos/ramwin/wechatpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ramwin/wechatpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ramwin/wechatpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ramwin/wechatpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ramwin/wechatpy/statuses/{sha}","languages_url":"https://api.github.com/repos/ramwin/wechatpy/languages","stargazers_url":"https://api.github.com/repos/ramwin/wechatpy/stargazers","contributors_url":"https://api.github.com/repos/ramwin/wechatpy/contributors","subscribers_url":"https://api.github.com/repos/ramwin/wechatpy/subscribers","subscription_url":"https://api.github.com/repos/ramwin/wechatpy/subscription","commits_url":"https://api.github.com/repos/ramwin/wechatpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ramwin/wechatpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ramwin/wechatpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ramwin/wechatpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ramwin/wechatpy/contents/{+path}","compare_url":"https://api.github.com/repos/ramwin/wechatpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ramwin/wechatpy/merges","archive_url":"https://api.github.com/repos/ramwin/wechatpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ramwin/wechatpy/downloads","issues_url":"https://api.github.com/repos/ramwin/wechatpy/issues{/number}","pulls_url":"https://api.github.com/repos/ramwin/wechatpy/pulls{/number}","milestones_url":"https://api.github.com/repos/ramwin/wechatpy/milestones{/number}","notifications_url":"https://api.github.com/repos/ramwin/wechatpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ramwin/wechatpy/labels{/name}","releases_url":"https://api.github.com/repos/ramwin/wechatpy/releases{/id}","deployments_url":"https://api.github.com/repos/ramwin/wechatpy/deployments","created_at":"2018-09-12T07:41:45Z","updated_at":"2018-09-13T08:09:33Z","pushed_at":"2018-09-13T08:09:31Z","git_url":"git://github.com/ramwin/wechatpy.git","ssh_url":"git@github.com:ramwin/wechatpy.git","clone_url":"https://github.com/ramwin/wechatpy.git","svn_url":"https://github.com/ramwin/wechatpy","homepage":"http://docs.wechatpy.org","size":1177,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jxtech:master","ref":"master","sha":"f79e2a0f589dce2cd26467bc24bb9fa28b9a76da","user":{"login":"jxtech","id":12945147,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTQ1MTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/12945147?v=4","gravatar_id":"","url":"https://api.github.com/users/jxtech","html_url":"https://github.com/jxtech","followers_url":"https://api.github.com/users/jxtech/followers","following_url":"https://api.github.com/users/jxtech/following{/other_user}","gists_url":"https://api.github.com/users/jxtech/gists{/gist_id}","starred_url":"https://api.github.com/users/jxtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxtech/subscriptions","organizations_url":"https://api.github.com/users/jxtech/orgs","repos_url":"https://api.github.com/users/jxtech/repos","events_url":"https://api.github.com/users/jxtech/events{/privacy}","received_events_url":"https://api.github.com/users/jxtech/received_events","type":"Organization","site_admin":false},"repo":{"id":23960826,"node_id":"MDEwOlJlcG9zaXRvcnkyMzk2MDgyNg==","name":"wechatpy","full_name":"jxtech/wechatpy","owner":{"login":"jxtech","id":12945147,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTQ1MTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/12945147?v=4","gravatar_id":"","url":"https://api.github.com/users/jxtech","html_url":"https://github.com/jxtech","followers_url":"https://api.github.com/users/jxtech/followers","following_url":"https://api.github.com/users/jxtech/following{/other_user}","gists_url":"https://api.github.com/users/jxtech/gists{/gist_id}","starred_url":"https://api.github.com/users/jxtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxtech/subscriptions","organizations_url":"https://api.github.com/users/jxtech/orgs","repos_url":"https://api.github.com/users/jxtech/repos","events_url":"https://api.github.com/users/jxtech/events{/privacy}","received_events_url":"https://api.github.com/users/jxtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jxtech/wechatpy","description":"WeChat SDK for Python","fork":false,"url":"https://api.github.com/repos/jxtech/wechatpy","forks_url":"https://api.github.com/repos/jxtech/wechatpy/forks","keys_url":"https://api.github.com/repos/jxtech/wechatpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jxtech/wechatpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jxtech/wechatpy/teams","hooks_url":"https://api.github.com/repos/jxtech/wechatpy/hooks","issue_events_url":"https://api.github.com/repos/jxtech/wechatpy/issues/events{/number}","events_url":"https://api.github.com/repos/jxtech/wechatpy/events","assignees_url":"https://api.github.com/repos/jxtech/wechatpy/assignees{/user}","branches_url":"https://api.github.com/repos/jxtech/wechatpy/branches{/branch}","tags_url":"https://api.github.com/repos/jxtech/wechatpy/tags","blobs_url":"https://api.github.com/repos/jxtech/wechatpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jxtech/wechatpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jxtech/wechatpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jxtech/wechatpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jxtech/wechatpy/statuses/{sha}","languages_url":"https://api.github.com/repos/jxtech/wechatpy/languages","stargazers_url":"https://api.github.com/repos/jxtech/wechatpy/stargazers","contributors_url":"https://api.github.com/repos/jxtech/wechatpy/contributors","subscribers_url":"https://api.github.com/repos/jxtech/wechatpy/subscribers","subscription_url":"https://api.github.com/repos/jxtech/wechatpy/subscription","commits_url":"https://api.github.com/repos/jxtech/wechatpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jxtech/wechatpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jxtech/wechatpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jxtech/wechatpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jxtech/wechatpy/contents/{+path}","compare_url":"https://api.github.com/repos/jxtech/wechatpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jxtech/wechatpy/merges","archive_url":"https://api.github.com/repos/jxtech/wechatpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jxtech/wechatpy/downloads","issues_url":"https://api.github.com/repos/jxtech/wechatpy/issues{/number}","pulls_url":"https://api.github.com/repos/jxtech/wechatpy/pulls{/number}","milestones_url":"https://api.github.com/repos/jxtech/wechatpy/milestones{/number}","notifications_url":"https://api.github.com/repos/jxtech/wechatpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jxtech/wechatpy/labels{/name}","releases_url":"https://api.github.com/repos/jxtech/wechatpy/releases{/id}","deployments_url":"https://api.github.com/repos/jxtech/wechatpy/deployments","created_at":"2014-09-12T13:03:28Z","updated_at":"2018-09-12T17:46:00Z","pushed_at":"2018-09-13T08:09:33Z","git_url":"git://github.com/jxtech/wechatpy.git","ssh_url":"git@github.com:jxtech/wechatpy.git","clone_url":"https://github.com/jxtech/wechatpy.git","svn_url":"https://github.com/jxtech/wechatpy","homepage":"http://docs.wechatpy.org","size":1194,"stargazers_count":1597,"watchers_count":1597,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":445,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":445,"open_issues":18,"watchers":1597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/387"},"html":{"href":"https://github.com/jxtech/wechatpy/pull/387"},"issue":{"href":"https://api.github.com/repos/jxtech/wechatpy/issues/387"},"comments":{"href":"https://api.github.com/repos/jxtech/wechatpy/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jxtech/wechatpy/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/jxtech/wechatpy/statuses/68c7ca84d32747c73b03f6bfdfdfd9ce2bf69f8d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ramwin"}}