Published
Edited
Nov 28, 2020
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// ghKey = Secret("GitHub_API_KEY")
viewof ghKey
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
PRtables('abserari')
Insert cell
PRCommunity(['abserari', 'skyao'], 'dapr')
Insert cell
IssuesCommunity(['qqeasonchen', 'skyao'], 'dapr')
Insert cell
Insert cell
PRtables = async user => {
var PR = await github3`search/issues?q=author:${user}+type:pr`;
var DisplayPR = [];
PR.items.map(d => {
var pr = {};
var repo = repoName(d.repository_url);
if (repo.lastIndexOf('yhyddr/') !== -1) {
return;
}
pr.repo = `<a href="https://github.com/${repo}/pull${issueNum}/">
${repo}
</a>`;

var issueNum = d.url.substring(d.url.lastIndexOf('/'));

pr.statusHTML = `<a href="https://github.com/${repo}/pull${issueNum}/">
<img src="https://img.shields.io/github/pulls/detail/s/${repo}${issueNum}.svg?label=" alt="GitHub issue state">
</a>`;

pr.checksHTML = `<a href="https://github.com/${repo}/pull${issueNum}/">
<img src="https://img.shields.io/github/status/contexts/pulls/${repo}${issueNum}.svg?label=" alt="GitHub issue state">
</a>`;

pr.content = d.body;

DisplayPR.push(pr);
});

return table(DisplayPR, {
nully: () => '<span style="color: red">No data</span>',
limit: 500,
enableFilter: false,
enableCSVDownload: true,
columns: [
{
key: 'repo',
name: 'Repo',
render: val => `${val}`
// `<a href="https://google.com/?q=${val}" target="_blank">${val}</a>`
},
{
key: 'statusHTML',
name: 'Status',
render: val => `${val}`
},

{
key: 'checksHTML',
name: 'Checks',
render: val => `${val}`
},
// 'body'
{
key: 'content',
name: 'Content',
render: val => `${val}`
}
]
});
}
Insert cell
IssuesCommunity = async (users, project) => {
let issues = [];
for (let i = 0; i < users.length; i++) {
let user = users[i];
var issue = await github3`search/issues?q=author:${user}+org:${project}+is:issue&sort=created&order=desc`;
issues = issues.concat(issue.items);
}

var DisplayPR = [];
issues.map(d => {
var pr = {};
var repo = repoName(d.repository_url);
if (repo.lastIndexOf('yhyddr/') !== -1) {
return;
}

var issueNum = d.url.substring(d.url.lastIndexOf('/'));

pr.repo = `<a href="https://github.com/${repo}/pull${issueNum}/">
${repo}
</a>`;

pr.statusHTML = `<a href="https://github.com/${repo}/pull${issueNum}/">

<img src="https://img.shields.io/github/issues/detail/state/${repo}${issueNum}" alt="GitHub issue state">
</a>`;

pr.title = d.title;

pr.user = d.user.login;

pr.updated_at = d.updated_at;

DisplayPR.push(pr);
});
DisplayPR.sort(Orderby("updated_at"));

return table(DisplayPR, {
nully: () => '<span style="color: red">No data</span>',
limit: 500,
enableFilter: false,
enableCSVDownload: true,
columns: [
{
key: 'repo',
name: 'Repo',
render: val => `${val}`
// `<a href="https://google.com/?q=${val}" target="_blank">${val}</a>`
},
{
key: 'statusHTML',
name: 'Status',
render: val => `${val}`
},

{
key: 'user',
name: 'Follow',
render: val => `${val}`
},
// 'body'
{
key: 'title',
name: 'Title',
render: val => `${val}`
}
]
});
}
Insert cell
Orderby = p => (m, n) => {
return Date.parse(n[p]) - Date.parse(m[p]);
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more