Last active
January 25, 2017 03:19
-
-
Save jnothman/bf76d02f60af6476221ec65c63c77e60 to your computer and use it in GitHub Desktop.
Bookmarklet: view scikit-learn changed documentation on CircleCI from PR page
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
javascript: | |
var status_lists = document.getElementsByClassName('merge-status-list'); | |
var ci_links = status_lists[status_lists.length - 1].getElementsByClassName('status-actions'); | |
for (var i in ci_links) { | |
var ci_link = ci_links[i]; | |
if (ci_link.tagName.toUpperCase() != 'A') { | |
ci_link = ci_link.getElementsByTagName('a')[0]; | |
} | |
var url = ci_link.getAttribute('href'); | |
var match = /circleci.com\/.*?([0-9]+)\?/.exec(url); | |
if (match) { | |
var target = 'http://scikit-learn.org/circle?' + match[1] + '/_changed.html'; | |
console.log(target); | |
window.open(target); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment