Skip to content

Instantly share code, notes, and snippets.

@fxxkscript
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save fxxkscript/11401983 to your computer and use it in GitHub Desktop.

Select an option

Save fxxkscript/11401983 to your computer and use it in GitHub Desktop.
JIRA每日完成任务
var nodes = document.getElementsByTagName('item');
var s = '\n';
var data = {};
for(var i = 1; i < nodes.length; i++) {
var title = nodes[i].getElementsByTagName('title')[0].innerHTML,
author = nodes[i].getElementsByTagName('assignee')[0].innerHTML;
data[author] = data[author] || [];
data[author].push(title.replace(/\[\w+\-\d+\]\s*/, ''));
}
for (var author in data) {
s += author + '\n';
for (var i = 0; i < data[author].length; i++) {
s += i + 1 + ': ' + data[author][i] + '\n';
}
s += '\n';
}
console.log(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment