Last active
July 27, 2017 07:22
-
-
Save backflip/9e9dfedb320d8607ef03092afedca8a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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