Skip to content

Instantly share code, notes, and snippets.

@youpy
Created January 29, 2009 08:56
Show Gist options
  • Save youpy/54474 to your computer and use it in GitHub Desktop.
Save youpy/54474 to your computer and use it in GitHub Desktop.
// ==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