Github API按照created_at字段排序搜索结果 [英] Github API sorting search results by the created_at field
本文介绍了Github API按照created_at字段排序搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何创建按 created_at
字段排序的搜索查询?我试过:
How can I create a search query sorted by the created_at
field? I've tried:
https://api.github.com/search/repositories?q=blog&sort=created_at&order=desc
和
https://api.github.com/search/repositories?q=blog&sort=created&order=desc
但我得到的结果与此查询相同:
But I get the same results as this query:
https://api.github.com/search/repositories?q=blog
推荐答案
sort
参数取三个值: stars
,分叉
或已更新
:
排序字段。其中一个
stars
,分叉
或已更新
。默认值:结果按最佳匹配排序。
The sort field. One of
stars
,forks
, orupdated
. Default: results are sorted by best match.
似乎无法按创建日期排序,但您可以阅读搜索查询对数组的响应并从那里进行排序。
It doesn't appear to be possible to sort by creation date, but you could read the response of the search query into an array and sort from there.
这篇关于Github API按照created_at字段排序搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文