Skip to content

Instantly share code, notes, and snippets.

@saitamanodoruji
Forked from satyr/gist_logs.user.js
Created May 10, 2012 15:33
Show Gist options
  • Save saitamanodoruji/2653937 to your computer and use it in GitHub Desktop.
Save saitamanodoruji/2653937 to your computer and use it in GitHub Desktop.
Shows commit logs on Gist.
// ==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