-
-
Save saitamanodoruji/2653937 to your computer and use it in GitHub Desktop.
Shows commit logs on Gist.
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
// ==UserScript== | |
// @name gist logs | |
// @namespace http://d.hatena.ne.jp/murky-satyr | |
// @description Shows commit logs on Gist. | |
// @include https://gist.github.com/* | |
// ==/UserScript== | |
function $(expression, context) { | |
return Array.prototype.slice.call((context||document).querySelectorAll(expression)) | |
} | |
$('#revisions .id').forEach(get) | |
function get(a) { | |
GM_xmlhttpRequest({ | |
method: 'get', | |
url: 'https://raw.github.com/gist' | |
+ a.pathname | |
+ '/meta', | |
onload: function(r) { | |
var mes = document.createElement('div') | |
mes.className = 'log' | |
mes.innerHTML = r.responseText.match(/\n\n[\s\S]*$/m)[0] | |
a.parentNode.appendChild(mes) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment