实现命令行方式查询StackOverFlow。调用 StackExchange API 搜索关键字,返回StackOverFlow上相关度最高的提问列表及回答(按投票排序)。
- 克隆github仓库:
git clone https://github.com/Kunkgg/askso.git
- 安装:
python setup.py install
- 命令行非常简单
Usage: askso.py [OPTIONS] KEYWORDS
Options:
--searchlistsize INTEGER 搜索多少个与关键字相关性最高的提问,default=10
--queslistsize INTEGER 显示多少个与关键字相关性最高的提问,default=10
--answerlistsize INTEGER 解析关于某个提问投票得分前多少名的回答,default=5
--help Show this message and exit.
- 举例
搜索关键字python decorator,在命令行输入:
askso "python decorator"
即可
- Stack Exchange API
- github:gautamkrishnar/socli
- github:gleitz/howdoi