Print This Post Print This Post

Liberry Humor

Justin from 8bitlibrary posted a question to Twitter this morning, wondering if he should register 8bitliberry and redirect traffic over to the new URL.

This question led me to wonder how difficult it would be to write a browser plugin that would replace every instance of the word “liberry” with “liberry”. A very short Google session later, I learned that w/ Javascript and Greasemonkey, this is very easily done. In fact, I didn’t have to do much of anything. An existing script was available, so all that really needed to be done was to enter in the words I wanted changed.

The resulting Greasemonkey script (liberry_word_change.user) is nothing more than the above script with a list of liberry words to be changed.

It’s small, but fun. When it’s time to climb down off our liberry high horse, this is a fun little trick to help us relax and stop taking ourselves so seriously.

Liberries FTW!!1!

Code:

// ==UserScript==// @name Liberry Changer // @namespace http://guest2424.blogspot.com/2008/12/greasemonkey-replace-words-on-websites.html/ // @include */ // ==/UserScript==

(function() {
var replacements, regex, key, textnodes, node, s;
textnodes = document.evaluate( "//body//text()", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < textnodes.snapshotLength; i++) {
node = textnodes.snapshotItem(i);
if(node != null && node.nodeName == '#text' && /\S/.test(node.nodeValue))
{

s = node.data;

s = s.replace( /\bWORD OR WORDS TO GET RID OF\b/g, "WORDS THAT IT IS REPLACED WITH OR JUST 2 QUOTES FOR NOTHING");
s = s.replace( /\bWORDS CAN NOT CONTAIN PERIODS OR COMMAS OR SINGLE OR DOUBLE QUOTES\b/g, "IF YOU DO IT WILL NOT WORK");
s = s.replace( /\bBEFORE EACH THING WILL BE A SMALL LETTER B AND END WITH SLASH B AND IF YOU REMOVE ANYTHING BUT THESE BOLD WORLDS IT WONT WORK\b/g, "BELOW ARE SHORTER EXAMPLES");
s = s.replace( /\blibrary\b/g, "liberry");
s = s.replace( /\bLibrary\b/g, "Liberry");
s = s.replace( /\bLibraries\b/g, "Liberries");
s = s.replace( /\blibraries\b/g, "liberries");
s = s.replace( /\bLibrarian\b/g, "Liberrian");
s = s.replace( /\blibrarian\b/g, "liberrian");
s = s.replace( /\bLibrarians\b/g, "Liberrians");
s = s.replace( /\blibrarians\b/g, "liberrians");
node.data = s;

 

}} })();


You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

AddThis Social Bookmark Button

One Response to “Liberry Humor”

  1. It was in the range of end of December 2009 and early of January 2010. As far as we know, Google will update PR occasionally for every 3 months. So will be expecting new updates on March – April 2010.