是否有一个 API 调用或我未能推翻的任何脚本将我的所有 Gist 从 Github 拉到外部 git repo 或只是返回我他们的名字列表?我知道每一个都是一个单独的 git repo,所以我假设我能做的最好的就是获取后者,然后编写脚本将它们全部放到我的本地盒子上。
编辑 1:我知道将 git repos 从一项服务拉到另一项服务,我专门寻找拥有 411 的人来收集我拥有的所有 Gist 的权威列表,无论是私人的还是公共的。我还认为这可能对其他人有用。与其说是迁移,不如说是一种备份策略。. . 各种各样的。
编辑 2:所以,看来这可能是不可能的。我显然没有用谷歌搜索更新的 Github/Gist API。其他 API 调用适用于简单的 curl 命令,但不适用于 Gist 的 v1 API。尽管如此,API 对所有私人和公共 Gists都说 TBD ,所以我认为这会将 cabash 放在整个事情上,除非一个开明的灵魂勾起了一个brotha。
$ curl http://github.com/api/v2/json/repos/show/alharaka
{"repositories":[{"url":"https://github.com/alharaka/babushka","has_wiki":true,"homepage":"http:
... # tons of more output
echo $?
0
$
这个不太热。
$ curl https://gist.github.com/api/v1/:format/gists/:alharaka
$ echo $?
0
$
编辑 3:在我被问到之前,我注意到 API 版本控制有所不同;这种“出色的破解”也无济于事。不过还是很酷。
$ curl https://gist.github.com/api/v2/:format/gists/:alharaka # Notice v2 instead of v1
$ echo $?
0
$