Skip to content

Instantly share code, notes, and snippets.

@Qofar
Created May 27, 2015 13:15
Show Gist options
  • Save Qofar/cb00cfe445f3ec3878b1 to your computer and use it in GitHub Desktop.
Save Qofar/cb00cfe445f3ec3878b1 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name LDR_YouTubeThumbnails
// @include http://reader.livedoor.com/reader/*
// @version 0.1
// ==/UserScript==
(function(){
function source() {
window.register_hook('before_printfeed', function(feed) {
if(feed.channel.link.indexOf('http://www.youtube.com/') === 0) {
feed.items.forEach(function(item){
var id = item.link.match('v=([a-zA-Z0-9\_\-]+)&?')[1];
item.body += '<img src="http://i.ytimg.com/vi/' + id + '/mqdefault.jpg" />';
});
}
});
}
var script = document.createElement('script');
script.type = 'text/javascript';
script.innerHTML = '(' + source.toString() + ')();';
document.body.appendChild(script);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment