Created
August 21, 2015 18:22
-
-
Save cdl/854c42f5ec908a048290 to your computer and use it in GitHub Desktop.
This file contains 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
// Snippet for extracting PR titles and links from a Github "compare" page | |
// Useful for creating changelogs! | |
var output = []; | |
var links = $('.issue-link'); | |
if(!window.location.href.indexOf('github.com')) { alert('Not a Github compare page!'); } | |
links = Array.prototype.slice.call(links); | |
links = links.filter(function(link){ | |
return link.innerText.match(/^#/); | |
}); | |
links.forEach(function(link) { | |
var text = ['-']; | |
var pullLink = $(link).attr('href'); | |
text.push('[' + link.innerText + '](' + pullLink + ')'); | |
text.push(link.title); | |
output.push(text.join(' ')); | |
}); | |
console.log(output.join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment