Github API 按 created_at 字段对搜索结果进行排序 [英] Github API sorting search results by the created_at field

查看:27
本文介绍了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 参数 只取三个值之一:starsforksupdated:

排序字段.starsforksupdated 之一.默认:结果按最佳匹配排序.

The sort field. One of stars, forks, or updated. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆