// De.linque.nt BlogDecrypt // version 0.1 BETA! // 2005-06-20 // Copyright (c) 2005, James Britt // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // -------------------------------------------------------------------- // // This is a Greasemonkey user script. To install it, you need // Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ // Then restart Firefox and revisit this script. // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "Blog Decrypt", and click Uninstall. // // Big thanks to Mark Pilgrim for writing Dive Into Greasemonkey! // http://diveintogreasemonkey.org/ // // -------------------------------------------------------------------- // // ==UserScript== // @name Del.icio.us Post Reformer // @namespace http://neurogami.com/greasemonkey/ // @description Script to locate specific posts on Del.icio.us and reform them // Items page // @include http://del.icio.us/* // ==/UserScript== ( function() { // rot13 origin: 2000-01-08 nospam@geht.net http://tools.geht.net/rot13.html // Use at own risk. var last=""; var rot13map; // The problem is that JavaScript 1.0 // does not provide a Char to Numeric value conversion // Thus we define a map. // Because there are 64K UniCode characters, this map does not cover all characters. function rot13init() { var map = new Array(); var s = "abcdefghijklmnopqrstuvwxyz"; for (i=0; i='A' && b<='Z' || b>='a' && b<='z' ? rot13map[b] : b); } return s; } function reform_title( el ) { el.innerHTML = rot13( el.innerHTML ) } function reform_content( el ) { el.innerHTML = rot13( el.innerHTML ) } function xpath(query) { return document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); } function sub_xpath( query, node ) { return document.evaluate(query, node, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); } function is_delinquent( node ) { var re = /De\.linque\.nt\d\d/ var links = sub_xpath( "h3/a[@href]", node ) if ( re.test( links.snapshotItem( 0 ).href ) ) return true return false } function process_posts() { var re = /De\.linque\.nt\d\d/ var post_ary = xpath( "//div[@class='post']"); for ( var i=0; i < post_ary.snapshotLength; i++) { var n = post_ary.snapshotItem( i ) if ( is_delinquent( n ) ) { reform_title( sub_xpath( 'h3/a', n ).snapshotItem( 0 ) ) reform_content( sub_xpath( 'div[@class]', n ).snapshotItem( 0 ) ) } } } process_posts(); } )();