LDR の CodeRepos のフィードにユーザのアイコンを挿入するグリモン
こんな感じにアイコンが挿入される。
(ちょうど僕の前のコミットだったので id:tokuhirom さんのフィードを例に使わせて頂きました!)
インストールする場合はこちらからどうぞ。
// ==UserScript== // @name LDR add profile icon for CodeRepos // @namespace http://d.hatena.ne.jp/gan2/ // @include http://reader.livedoor.com/reader/ // @version 0.1 // ==/UserScript== (function () { var w = unsafeWindow; var feed_pattern = new RegExp("^http://coderepos.org/share/$"); w.register_hook('before_printfeed', function(feed) { if (feed_pattern.test(feed.channel.link)) { if (feed.is_added_icon) return; feed.items.forEach(function(item) { var author = item.author; item.body = [ '<img width="16" height="16" alt="" style="margin-right: 0.5em; vertical-align: middle;"', ' src="http://www.hatena.ne.jp/users/', author.slice(0, 2), '/', author, '/profile_s.gif"/>', '<a style="border: medium none; background-image: none ! important; padding-left: 0pt;"', ' href="http://coderepos.org/share/wiki/Committers/', author, '"', ' title="', author, ' in Committer">', author, '</a>', item.body, '<br clear="both">' ].join(""); }); feed.is_added_icon = true; } }); })();