Skip to content

Instantly share code, notes, and snippets.

@backflip
Last active July 27, 2017 07:22
Show Gist options
  • Save backflip/9e9dfedb320d8607ef03092afedca8a3 to your computer and use it in GitHub Desktop.
Save backflip/9e9dfedb320d8607ef03092afedca8a3 to your computer and use it in GitHub Desktop.
(function() {
let total = 0,
issues = [].slice.call(document.querySelectorAll('.ghx-issue-compact .ghx-inner')).map((node) => {
let text = node.innerText,
time = text.match(/ \[(.*)h\]/) || '',
group = text.match(/^(.*?) - (.*?)/) || '',
feedback = text.match(/^\[(Needs feedback)\] /) || '';
if (time) {
text = text.replace(time[0], '');
time = parseFloat(time[1]);
total += time;
}
if (group) {
text = text.replace(group[0], '');
group = group[1];
}
if (feedback) {
text = text.replace(feedback[0], '');
group = group.replace(feedback[0], '');
group = group[1];
}
return {
group,
text,
time,
feedback
};
});
console.log(total);
copy(JSON.stringify(issues));
// → https://json-csv.com/
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment