Skip to content

Instantly share code, notes, and snippets.

@gladimdim
Created January 6, 2016 13:07
Show Gist options
  • Save gladimdim/374138e8f9a199abb40d to your computer and use it in GitHub Desktop.
Save gladimdim/374138e8f9a199abb40d to your computer and use it in GitHub Desktop.
Total lines sum calculator for bitbucket pull request
(function() {
var sumLines = (arr) => arr.reduce((prev,curr) => { return prev + Number.parseInt(curr.innerText)}, 0);
return {
'Pull request': $.find(".pull-request-title a")[0].text,
'Added': sumLines($.find(".lines-added")),
'Removed': sumLines($.find(".lines-removed"))
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment