
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
由于知乎给 Github 发了 DMCA 要求删除 zhihu-oauth 仓库,所以 Github 把仓库设置为不可公开访问了。所以目前我只能把最新版代码同步到我自己个人的 Git Server 上了。
虽然一直有用户和我反馈还在使用这个库,并且某些功能也确实可以继续正常使用,但由于本人已经不用知乎多年,所以这个库其实有两年多没更新过了。
这次移动到个人站点之后,由于本站点不对外开放注册,游客就没法使用 Issue 和 PR 功能,所以可以预见的未来估计也不会有什么更新了,这里基本只提供代码备份和下载功能。
由于以上原因,README 中的捐款渠道也已一并删除。
如果你有想交流的问题,请使用邮件,或者 Twitter 联系我。
—— 2019.10.19
同学们,由于知乎新的 API 验证 UA,0.0.14 之前的版本已经不可用了,请尽快升级到 0.0.14 以上版本。
最近在尝试解析出知乎官方未开放的 OAuth2 接口,顺便提供优雅的使用方式,作为 zhihu-py3 项目的继任者。
恩,理论上来说会比 zhihu-py3 更加稳定,原因如下:
这一新库与 zhihu-py3 相比速度更快。有关速度对比的详细信息请点击这里。
这个库是 Py2 和 Py3 通用的! 但是 Py3 的优先级比 Py2 高,也就是说,我会优先保证在 Py3 下的稳定性和正确性。毕竟在我学的时候选了 Py3,所以对 2 与 3 的差异了解不是很清楚,Py2 只能尽力而为了,
后期的计划是这样的:
由于现在使用的 CLIENT_ID 和 SECRET 的获取方法并不正当,所以请大家暂时不要大规模宣传,自己用用就好啦,Thanks。
等我什么时候觉得时机成熟(等知乎真•开放 OAuth 申请?),会去知乎专栏里宣传一波的。
目前版本是 0.0.41,没更新的快更新一下,更新说明在这里。
0.0.41 版本修复了 Feed 流的一些问题,加上了 Topic.activities
接口。
0.0.40 版本增加了 Feed 首页信息流的支持。
pip install -U zhihu_oauth
如果安装遇到问题,请查看文档:安装
请参见文档:登录
代码:
from zhihu_oauth import ZhihuClient
client = ZhihuClient()
client.load_token('token.pkl')
me = client.me()
print('name', me.name)
print('headline', me.headline)
print('description', me.description)
print('following topic count', me.following_topic_count)
print('following people count', me.following_count)
print('followers count', me.follower_count)
print('voteup count', me.voteup_count)
print('get thanks count', me.thanked_count)
print('answered question', me.answer_count)
print('question asked', me.question_count)
print('collection count', me.collection_count)
print('article count', me.articles_count)
print('following column count', me.following_column_count)
输出:
name 7sDream
headline 二次元普通居民,不入流程序员,http://0v0.link
description 关注本AI的话,会自动给你发私信的哟!
following topic count 35
following people count 101
followers count 1294
voteup count 2493
get thanks count 760
answered question 258
question asked 18
collection count 9
article count 7
following column count 11
更多功能请参见文档:使用方法
完整的文档可以在这里 找到。我写的文档好吧,可详细了……有啥问题先去找文档。我写的那么累你们看都不看我好不服啊!
(貌似 ReadTheDocs 在伟大的国家访问速度有点慢,建议自备手段。)
由于开发不积极,不再接受捐款。
MIT
FAQs
尝试解析出知乎官方未开放的 OAuth2 接口,并提供优雅的使用方式,作为 zhihu-py3 项目的替代者
We found that zhihu-oauth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.