Skip to content

Instantly share code, notes, and snippets.

@jnothman
Last active January 25, 2017 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnothman/bf76d02f60af6476221ec65c63c77e60 to your computer and use it in GitHub Desktop.
Save jnothman/bf76d02f60af6476221ec65c63c77e60 to your computer and use it in GitHub Desktop.
Bookmarklet: view scikit-learn changed documentation on CircleCI from PR page
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