git - 下载与主题匹配的 GitHub 存储库列表?

标签 git github command-line github-api

有什么方法可以下载与 GitHub 主题匹配的项目列表吗? 例如,如果我写:

https://github.com/topics/haskell

在 Web 浏览器中,返回包含与 Haskell 相关的 GitHub 项目的页面。我读了他们的 GitHub API,但他们似乎没有实现该功能:https://developer.github.com/v3/

还有端点 https://api.github.com/似乎不包含任何选项。我的尝试所得到的一切,例如 https://api.github.com/topics/haskell是:

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3"
}

最佳答案

如果您想搜索与主题匹配的存储库,请使用 /search/repositories带有 topic 属性:

curl -H "Accept: application/vnd.github.mercy-preview+json" \
    https://api.github.com/search/repositories?q=topic:haskell

您必须在仍处于开发者预览版时提供application/vnd.github.mercy-preview+json:

Note: The topics property for repositories on GitHub is currently available for developers to preview. To view the topics property in calls that return repository results, you must provide a custom media type in the Accept header:

application/vnd.github.mercy-preview+json

关于git - 下载与主题匹配的 GitHub 存储库列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48390046/

相关文章:

git - 快速列出大量文件的最后提交日期

`--preserve-merges` 的 Git 选项?

linux - 如何使用受密码保护的私钥执行 salt 状态 git.latest

git - 在另一个 git 仓库中维护 git 仓库

windows - 如何从命令行检查特定的 Subversion 修订版?

git - 试图忽略 .gitignore 中的 .pyc 扩展名

ios - 为 iOS 推送通知导入 SSL 证书会阻止其他开发人员处理该项目吗?

github - 如何在 Github Actions 中失败?

php - Drupal 7 模块 shell_exec 问题

java - 如何在Java args中添加文件路径