possible to embed Github list of issues (with specific tag) on website?

后端 未结 2 1243
盖世英雄少女心
盖世英雄少女心 2021-02-06 04:34

Does anyone know of an easy way to embed the list of issues with a specific tag from github onto a website?

This is to embed a list of open bugs on a project website.

2条回答
  •  长发绾君心
    2021-02-06 04:59

    Solution using jQuery:

    There is a way to this easily using the github api using just javascript (no need to set up github account, registering api tokens, etc..)

    Below is a small demo using jquery to get a list of all the open bugs for a github project (jquery in this example)

    var urlToGetAllOpenBugs = "https://api.github.com/repos/jquery/jquery/issues?state=open&labels=bug";
    
    $(document).ready(function () {
    $.getJSON(urlToGetAllOpenBugs, function (allIssues) {
        $("div").append("found " + allIssues.length + " issues
    "); $.each(allIssues, function (i, issue) { $("div") .append("" + issue.number + " - " + issue.title + "
    ") .append(issue.body + "


    "); }); }); });

    jsfiddle: http://jsfiddle.net/bso6xLee/2/

提交回复
热议问题