我使用 Github API V3 来获取存储库的分叉计数,我使用:
GET /repos/:owner/:repo/forks
Run Code Online (Sandbox Code Playgroud)
即使存储库包含更多结果,该请求也只给我带来 30 个结果,我搜索了一下,我发现由于内存限制,API 每页只返回 30 个结果,如果我想要下一个结果,我必须指定页数.
只有我我不需要所有这些信息,我需要的只是叉子的数量。
有没有办法只获得叉子的数量?
因为如果我开始每页循环一页,如果存储库包含数千个结果,我的脚本可能会崩溃。
我正在使用 Github 的Web API来控制我自己的分支和上游。任务是从上游 repo 中提取并合并到我的 fork 中。当发生冲突时,我希望 API 强制合并文件,并在文件中显示冲突,如下所示:
>>>>>>
This line is from my fork
======
This line is from upstream
<<<<<<
Run Code Online (Sandbox Code Playgroud)
这可以在运行git pull或git merge时使用 git 客户端自动完成,但是 Github API ( https://developer.github.com/v3/repos/merging/ ) 只会在发生冲突时失败,而不是尝试使冲突看起来像上面那样。有什么办法可以用 Github API 实现上述目标吗?谢谢!
我想在我的 iOS 应用程序中使用 Github 搜索 API Restfully 查询基于“语言”(编程语言)作为搜索的主要参数的公共存储库。
从 API 文档中我可以理解以下 api 给了我我需要的东西。
https://api.github.com/search/repositories?q=tetris+language:assembly&sort=stars&order=desc
尽管如此,这会为特定语言返回 370 个这样的存储库。
我想在 iOS 应用程序中实现分页,以便我一次只能获取大约 10-30 个整数。我已经看到 github 为他们的一些 Api 提供了分页。
但是,当我尝试使用参数中包含的“page”和“per_page”的以下 api 时,我仍然得到相同的结果,不限于我想要的页面或 per_page。
github api 是否为这个搜索 api 提供分页?如果是这样,我错过了什么?我该如何使用它?
在 Github 上,当您访问与提交对应的页面时 -像这样- 您可以看到以下内容:
我想象在分支 ( master)旁边,页面显示了包含该特定提交的存储库标签(在本例中为:4.8.0, 4.7.1, 4.7.0, 4.6.2, 4.6.1和4.6.0)。
有没有办法通过 GitHub REST API 或 GIT 命令行工具访问该信息?
Github 问题可能包含一段时间的“反应”(如此处所述:https : //github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)
我想使用 Github api 接收该信息,但在遇到问题时似乎没有类似的东西,例如
api.github.com/repos/twbs/bootstrap/issues/19575
Run Code Online (Sandbox Code Playgroud)
该信息似乎不在该响应中。此外,我没有找到可以检索该信息的另一个 API 调用。如何得到这些“反应”?
我在 Meteor 中使用 github API 但无法解决这个问题:
此代码尝试获取某个 repo 的总流量。
HTTP.call( 'GET', 'https://api.github.com/repos/hackmdio/hackmd/traffic/views',
{
headers:
{
'Content-Type':'application/json',
"Accept":"application/vnd.github.v3+json",
"User-Agent": "whales"
},
},
function( error, response ) {
if ( error ) {
console.log('---------------------------error occurred-----------------------------------')
console.log('---------------------------error occurred-----------------------------------')
console.log( error );
} else {
console.log('--------------------------data got it!!-------------------------------------')
console.log('--------------------------data got it!!-------------------------------------')
console.log(response);
}
});
Run Code Online (Sandbox Code Playgroud)
错误:
{
"message": "If you would like to help us test the Repo Traffic API during its preview period, you must specify a custom media type in the 'Accept' header. …Run Code Online (Sandbox Code Playgroud) 我从 Github API 获取一些数据,我遇到了这些数据以获取特定存储库的语言,我得到了以下对象。我想知道这些数值是什么意思?
{
"JavaScript": 1300078,
"CSS": 71202,
"Shell": 2513
}
Run Code Online (Sandbox Code Playgroud) 我想获取在指定时间段内为存储库打开/关闭的问题数量的统计信息。我可以通过单击见解选项卡在 GitHub 中查看此信息。
例如:https : //github.com/nodejs/node/pulse
我可以通过 GitHub Rest API v3 提取任何这些信息吗?我正在查看文档,但找不到任何信息。提前致谢
我会很容易地解释我的问题:
我想与 github webhooks 交互以在我的用户(或登录用户)单击 repo 上的 star(应该是这个钩子事件)时获取。
我有一个带有 node + express 的简单服务器,但我真的不明白如何执行它。有人可以帮助我吗?
const chalk = require('chalk');
const express = require('express');
const serverConfig = require('./config/server.config');
const app = express();
const port = process.env.PORT || serverConfig.port;
console.log(chalk.bgGreen(chalk.black('### Starting server... ###'))); // eslint-disable-line
app.listen(port, () => {
const uri = `http://localhost:${port}`;
console.log(chalk.red(`> Listening ${chalk.white(serverConfig.env)} server at: ${chalk.bgRed(chalk.white(uri))}`)); // eslint-disable-line
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试向 Github api 发出请求,并从打开的存储库中的文件中获取内容(代码)。我curl -i在终端上做了一个简单的操作,它返回了一些已编码的内容(根据文档)。如何解码该内容?当我将代码输出到 html textarea 时,是否可以将代码置于正确的格式(缩进等)中?
github-api ×10
github ×7
git ×3
api ×1
fork ×1
http ×1
ios ×1
javascript ×1
merge ×1
meteor ×1
node.js ×1
octokit ×1
octokit.net ×1
pagination ×1