- From: Jake Archibald <notifications@github.com>
- Date: Wed, 27 Jul 2016 07:29:14 -0700
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Wednesday, 27 July 2016 14:29:44 UTC
To future-me: here's the script for getting issue data in the format above:
```js
function getAllIssues(url) {
const allIssues = [];
return fetch(url).then(function processResponse(response) {
const nextLink = response.headers.get('link').split(',').find(a => a.trim().endsWith('rel="next"'));
const nextUrl = nextLink && nextLink.replace(/(^\s*<|>;.*$)/g, '');
return response.json().then(data => {
allIssues.push(...data);
if (nextUrl) {
return fetch(nextUrl).then(processResponse);
}
return allIssues;
});
});
}
getAllIssues('//api.github.com/repos/slightlyoff/ServiceWorker/issues?milestone=2').then(issues => {
window.issueStr = issues.map(issue => {
return ` * [#${issue.number} ${issue.title}](${issue.html_url})`;
}).join('\n');
});
```
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/932#issuecomment-235602681
Received on Wednesday, 27 July 2016 14:29:44 UTC