开发者

Query github api by location and language

How can I query the github api by a locati开发者_如何学JAVAon AND a programming language, and is there any pagination feature in the api?


It isn't possible to search repositories using location, via either site search or the API search, since location is an attribute on a user, not a repository.

As for pagination, the API claims to have it, but the online docs say to use ?start_page=N while Github support is saying to use ?page=N. I've tested and neither of these worked for me: I always get the first page, and no combination of parameters seem to advance to the next batch of results.


Using jQuery, pagination works something like this (below code works):

$(document).ready(function()
{
    var url = 'https://api.github.com/users/andrew/repos?page=1&per_page=100';

    $.getJSON(url + '&callback=?',null,function(data)
    {
        var output = JSON.stringify(data);

        document.write(output);
    });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜