Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CloudToButt.pem
Binary file modified CloudToButt.crx
Binary file not shown.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all:
DISPLAY=:0 sudo google-chrome --pack-extension=Source --pack-extension-key=CloudToButt.pem --user-data-dir=/tmp/foooo
sudo chown hank:hank Source.crx
mv Source.crx CloudToButt.crx
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
cloud-to-butt
Cloud To Butt Plus
=============

Chrome extension that replaces occurrences of 'the cloud' with 'my butt'
Chrome extension that replaces occurrences of 'the cloud' with 'my butt', and other amusing cloud-related substitutions.

[Direct download of crx file](https://github.com/panicsteve/cloud-to-butt/blob/master/CloudToButt.crx?raw=true)
[Direct download of crx file](https://github.com/hank/cloud-to-butt/blob/master/CloudToButt.crx?raw=true)

Screenshot Gallery
------------------

http://www.flickr.com/groups/cloud-to-butt/

Installation
------------

In Chrome, choose Window > Extensions. Drag CloudToButt.crx into the page that appears.

Safari Version
--------------

Can be found here: https://github.com/logancollins/cloud-to-butt-safari

Firefox Version
---------------

Can be found here: https://github.com/DaveRandom/cloud-to-butt-mozilla
33 changes: 30 additions & 3 deletions Source/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,36 @@ function walk(node)
}
}

function handleText(textNode)
{
textNode.nodeValue = textNode.nodeValue.replace(/\bthe cloud\b/gi, "my butt");
function handleText(textNode) {
var v = textNode.nodeValue;

// Deal with the easy case and french people
v = v.replace(/\b(Th|th|L|l)e (C|c)loud/g, function(match, p1, p2, offset, string) {
// t - 7 = m
// c - 1 = b
m = String.fromCharCode(p1.charCodeAt(0) - 7);
b = String.fromCharCode(p2.charCodeAt(0) - 1);
return m + "y " + b + "utt";
});

// Deal with private clouds
v = v.replace(/\b(P|p)rivate (C|c)loud/g, function(match, p1, p2, offset, string) {
// c - 1 = b
b = String.fromCharCode(p2.charCodeAt(0) - 1);
return b + "utt";
});
// Get the corner cases
if(v.match(/cloud/i)) {
// If we're not talking about weather
if(v.match(/PaaS|SaaS|IaaS|computing|data|storage|cluster|distributed|server|hosting|provider|grid|enterprise|provision|apps|hardware|software|/i)) {
v = v.replace(/(C|c)loud/gi, function(match, p1, offset, string) {
// c - 1 = b
b = String.fromCharCode(p1.charCodeAt(0) - 1);
return b + "utt";
});
}
}
textNode.nodeValue = v;
}


6 changes: 3 additions & 3 deletions Source/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 2,
"name": "Cloud To Butt",
"version": "1.0",
"description": "Replaces the text 'the cloud' with 'my butt'.",
"name": "Cloud To Butt Plus",
"version": "1.1",
"description": "Replaces the text 'the cloud' with 'my butt', as well as 'cloud' with 'butt' in certain contexts.",
"content_scripts":
[
{
Expand Down