{"action":"created","issue":{"url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/4","repository_url":"https://api.github.com/repos/7sDream/zhihu-oauth","labels_url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/4/comments","events_url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/4/events","html_url":"https://github.com/7sDream/zhihu-oauth/issues/4","id":148651332,"number":4,"title":"请问：访问用户关注的人的id的编码是什么？","user":{"login":"CHT2014","id":8972862,"avatar_url":"https://avatars.githubusercontent.com/u/8972862?v=3","gravatar_id":"","url":"https://api.github.com/users/CHT2014","html_url":"https://github.com/CHT2014","followers_url":"https://api.github.com/users/CHT2014/followers","following_url":"https://api.github.com/users/CHT2014/following{/other_user}","gists_url":"https://api.github.com/users/CHT2014/gists{/gist_id}","starred_url":"https://api.github.com/users/CHT2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHT2014/subscriptions","organizations_url":"https://api.github.com/users/CHT2014/orgs","repos_url":"https://api.github.com/users/CHT2014/repos","events_url":"https://api.github.com/users/CHT2014/events{/privacy}","received_events_url":"https://api.github.com/users/CHT2014/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-15T12:48:04Z","updated_at":"2016-04-15T18:05:38Z","closed_at":null,"body":"比如我直接访问‘an-yi-16’用户，返回的属性 id 还是 ‘an-yi-16’；\r\n```\r\n>>user = client.people('an-yi-16')\r\n>>print(user.id)\r\n    an-yi-16\r\n```\r\n当我访问该用户关注的一个用户时返回的 id 是如下的一串字符，请问该字符是什么编码，为什么和上面返回的不一样呢？\r\n```\r\n>>user.followings[0].name\r\n    'T44的弹药架'\r\n>>user.followings[0].id\r\n    '5c0f6f13961b2764593fe2accc10e13d'\r\n```\r\n上面的用户的 id 为 ‘blacklancer’。"},"comment":{"url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/comments/210567869","html_url":"https://github.com/7sDream/zhihu-oauth/issues/4#issuecomment-210567869","issue_url":"https://api.github.com/repos/7sDream/zhihu-oauth/issues/4","id":210567869,"user":{"login":"7sDream","id":7822577,"avatar_url":"https://avatars.githubusercontent.com/u/7822577?v=3","gravatar_id":"","url":"https://api.github.com/users/7sDream","html_url":"https://github.com/7sDream","followers_url":"https://api.github.com/users/7sDream/followers","following_url":"https://api.github.com/users/7sDream/following{/other_user}","gists_url":"https://api.github.com/users/7sDream/gists{/gist_id}","starred_url":"https://api.github.com/users/7sDream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7sDream/subscriptions","organizations_url":"https://api.github.com/users/7sDream/orgs","repos_url":"https://api.github.com/users/7sDream/repos","events_url":"https://api.github.com/users/7sDream/events{/privacy}","received_events_url":"https://api.github.com/users/7sDream/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T18:05:38Z","updated_at":"2016-04-15T18:05:38Z","body":"是这样的，知乎的people API接受两种ID，一种是人类可读的，就是主页URL最后的那一串，还有一种是知乎内部的hashid。\n因为我在类的内部做了缓存（为了性能考虑，减少网络请求），你用人类可读的ID创建对象，这时候取ID是不会访问网络的，会返回对象里暂存的你输入的ID。你随意访问他的一个属性，比如name，然后再输出一遍ID，就会是hashID了。因为一旦访问了知乎的API，它返回的都是那种内部hashid。\n因为取关注者的接口也是访问了网络的，所以输出也会是hashid。\n另外，知乎的Web端也是可以用hashid访问的。\n也就是说，你访问 https://www.zhihu.com/people/5c0f6f13961b2764593fe2accc10e13d 知乎会帮你自动重定向到 https://www.zhihu.com/people/blacklancer\n我现在用的是平板，可能说的不是很清除，看得不明白的话等我明天起床编辑一下QAQ。另外有能力的话其实可以自己读读代码～"}}