如果我键入以下命令:
$ curl https://api.github.com/users/KiCad/repos | grep full_name我希望它将返回所有KiCad存储库,但它返回:
"full_name": "KiCad/Air_Coils_SML_NEOSID.pretty",
"full_name": "KiCad/Buzzers_Beepers.pretty",
"full_name": "KiCad/Capacitors_Elko_ThroughHole.pretty",
"full_name": "KiCad/Capacitors_SMD.pretty",
"full_name": "KiCad/Capacitors_Tantalum_SMD.pretty",
"full_name": "KiCad/Capacitors_ThroughHole.pretty",
"full_name": "KiCad/Choke_Axial_ThroughHole.pretty",
"full_name": "KiCad/Choke_Common-Mode_Wurth.pretty",
"full_name": "KiCad/Choke_Radial_ThroughHole.pretty",
"full_name": "KiCad/Choke_SMD.pretty",
"full_name": "KiCad/Choke_Toroid_ThroughHole.pretty",
"full_name": "KiCad/Connect.pretty",
"full_name": "KiCad/Connectors_Molex.pretty",
"full_name": "KiCad/Converters_DCDC_ACDC.pretty",
"full_name": "KiCad/Crystals.pretty",
"full_name": "KiCad/Crystals_Oscillators_SMD.pretty",
"full_name": "KiCad/Diodes_SMD.pretty",
"full_name": "KiCad/Diodes_ThroughHole.pretty",
"full_name": "KiCad/Discret.pretty",
"full_name": "KiCad/Display.pretty",
"full_name": "KiCad/Displays_7-Segment.pretty",
"full_name": "KiCad/Divers.pretty",
"full_name": "KiCad/EuroBoard_Outline.pretty",
"full_name": "KiCad/Fiducials.pretty",
"full_name": "KiCad/Filters_HF_Coils_NEOSID.pretty",
"full_name": "KiCad/Fuse_Holders_and_Fuses.pretty",
"full_name": "KiCad/Hall-Effect_Transducers_LEM.pretty",
"full_name": "KiCad/Heatsinks.pretty",
"full_name": "KiCad/Housings_DFN_QFN.pretty",
"full_name": "KiCad/Housings_QFP.pretty",如果您查看https://github.com/KiCad,您将看到有更多的存储库。
有人遇到过这个问题吗?你怎么解决这个问题?
发布于 2014-12-07 14:01:01
GitHub API使用分页,默认为每页30项。你得用
curl -i https://api.github.com/users/KiCad/repos?per_page=100100是你在一页上能得到的最多的项目。指定了-i之后,您将看到头文件被打印出来,您要查找的标头是Links头。它将具有帮助您浏览页面的链接。其中一个链接应该看起来像
https://api.github.com/users/KiCad/repos?per_page=100&page=2所以如果你这么做
curl -i https://api.github.com/users/KiCad/repos?per_page=100&page=2你会得到101-200的回复。您可以继续这样做,直到在next头中没有任何Links链接,或者直到您意识到收到的结果少于100个。
https://stackoverflow.com/questions/27331849
复制相似问题