Created
January 29, 2009 08:56
-
-
Save youpy/54474 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 delicious rainbow | |
// @namespace http://d.hatena.ne.jp/youpy/ | |
// @include http://delicious.com/* | |
// @require http://gist.github.com/raw/3242/1a7950e033a207efcfc233ae8d9939b676bdbf46 | |
// ==/UserScript== | |
function rainbow(doc) { | |
$X('//div[starts-with(@class, "savers")]', doc).forEach(function(e) { | |
var url = e.childNodes[1].href; | |
var color = url.match(/url\/(.{6})/)[1]; | |
e.style.borderRight = '7px solid #' + color; | |
}); | |
} | |
function addDocumentFilter() { | |
window.AutoPagerize.addDocumentFilter(rainbow); | |
} | |
rainbow(document); | |
if(window.AutoPagerize) { | |
addDocumentFilter(); | |
} else { | |
window.addEventListener('GM_AutoPagerizeLoaded', addDocumentFilter, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment