github - 使用github api搜索主题对应的存储库时不能指定日期范围吗?
问题描述
您将使用 github api 搜索具有注册主题的存储库。
但是,由于搜索结果限制为 1000,我想搜索日期作为限制。如下所示。
https://api.github.com/search/repositories?q=topic:AAA&createdat:2020-10-11
自从我忽略了日期并进行了搜索,还有其他方法吗?
我想请求你的帮助。谢谢你。
解决方案
您的查询中有几个问题:
正确的搜索查询词是
created
(不是 createdat)搜索查询参数由空格分隔,如下所示:
topic:AAA created:2020-10-11
您的查询将是:https ://api.github.com/search/repositories?q=topic:AAA%20created:2020-10-11
从文档:
通过使用 >、>=、<、<= 和范围查询,您可以搜索早于或晚于另一个日期的日期,或者在某个日期范围内的日期。日期格式必须遵循 ISO8601 标准,即 YYYY-MM-DD(年-月-日)。
几个例子:
- 在日期之后创建:
https://api.github.com/search/repositories?q=topic:AAA%20created:%3E2017-10-11
- 在日期之间创建:
https://api.github.com/search/repositories?q=topic:AAA%20created:2017-01-01..2018-01-01
推荐阅读
- python - 重定向视图中的 Django NoReverseMatch 错误
- javascript - Swift 中的 ArrayBuffer 和 Float64Array
- embedded - 将项目从 ICCAVR 移植到 Atmel Studio 7.0 _flash 问题
- swift - 在 Swift 中向 xib 视图添加阴影
- regex - 无法选择正确的数据
- node.js - 如何将 POST 请求从 NodeJS 应用程序发送到 AWS Lambda?
- python - 在文件路径列表中查找以相同字符串开头的 python 文件
- css - 两个单词之间水平线的 CSS 技术
- python - 在专用内核上启动应用程序
- javascript - 与 node10 相比,Nodejs 自定义排序在 node12 中的行为不同