Skip to content

Instantly share code, notes, and snippets.

@chasingmaxwell
Last active December 28, 2015 06:59
Show Gist options
  • Save chasingmaxwell/7460627 to your computer and use it in GitHub Desktop.
Save chasingmaxwell/7460627 to your computer and use it in GitHub Desktop.
Bookmarklet that makes reading the news more fun a la http://xkcd.com/1288/. Instructions: Simply copy/paste the code in makeItFunBookmarklet.js into a bookmark in your browser (as the URL), open a news article, and click the bookmark. Yay!
(function() {
'use strict';
var body = document.getElementsByTagName('body')[0].innerHTML,
map = [
[/\bwitnesses\b/g, "these dudes I know"],
[/\bWitnesses\b/g, "These dudes I know"],
[/\ballegedly\b/g, "kinda probably"],
[/\bAllegedly\b/g, "Kinda probably"],
[/\bnew study\b/g, "tumblr post"],
[/\bNew study\b/g, "Tumblr post"],
[/\brebuild\b/g, "avenge"],
[/\bRebuild\b/g, "Avenge"],
[/\bspace\b/g, "spaaace"],
[/\bSpace\b/g, "Spaaace"],
[/\bGoogle Glass\b/g, "Virtual Boy"],
[/\bsmartphone\b/g, "Pokédex"],
[/\bSmartphone\b/g, "Pokédex"],
[/\belectric\b/g, "atomic"],
[/\bElectric\b/g, "Atomic"],
[/\bsenator\b/g, "elf-lord"],
[/\bSenator\b/g, "Elf-Lord"],
[/\bcar\b/g, "cat"],
[/\bCar\b/g, "Cat"],
[/\belection\b/g, "eating contest"],
[/\bElection\b/g, "Eating contest"],
[/\bcongressional leaders\b/g, "river spirits"],
[/\bCongressional leaders\b/g, "River spirits"],
[/\bhomeland security\b/g, "Homestar Runner"],
[/\bHomeland security\b/g, "Homestar Runner"],
[/\bHomeland Security\b/g, "Homestar Runner"],
[/\bcould not be reached for comment\b/g, "is guilty and everyone knows it"]
], r;
while ((r = map.shift()) && (body = String.prototype.replace.apply(body, r))) {}
document.getElementsByTagName('body')[0].innerHTML = body;
})();
javascript:(function(){"use strict";var e=document.getElementsByTagName("body")[0].innerHTML,t=[[%2F\bwitnesses\b%2Fg,"these dudes I know"],[%2F\bWitnesses\b%2Fg,"These dudes I know"],[%2F\ballegedly\b%2Fg,"kinda probably"],[%2F\bAllegedly\b%2Fg,"Kinda probably"],[%2F\bnew study\b%2Fg,"tumblr post"],[%2F\bNew study\b%2Fg,"Tumblr post"],[%2F\brebuild\b%2Fg,"avenge"],[%2F\bRebuild\b%2Fg,"Avenge"],[%2F\bspace\b%2Fg,"spaaace"],[%2F\bSpace\b%2Fg,"Spaaace"],[%2F\bGoogle Glass\b%2Fg,"Virtual Boy"],[%2F\bsmartphone\b%2Fg,"Pokédex"],[%2F\bSmartphone\b%2Fg,"Pokédex"],[%2F\belectric\b%2Fg,"atomic"],[%2F\bElectric\b%2Fg,"Atomic"],[%2F\bsenator\b%2Fg,"elf-lord"],[%2F\bSenator\b%2Fg,"Elf-Lord"],[%2F\bcar\b%2Fg,"cat"],[%2F\bCar\b%2Fg,"Cat"],[%2F\belection\b%2Fg,"eating contest"],[%2F\bElection\b%2Fg,"Eating contest"],[%2F\bcongressional leaders\b%2Fg,"river spirits"],[%2F\bCongressional leaders\b%2Fg,"River spirits"],[%2F\bhomeland security\b%2Fg,"Homestar Runner"],[%2F\bHomeland security\b%2Fg,"Homestar Runner"],[%2F\bHomeland Security\b%2Fg,"Homestar Runner"],[%2F\bcould not be reached for comment\b%2Fg,"is guilty and everyone knows it"]],n;while((n=t.shift())&&(e=String.prototype.replace.apply(e,n))){}document.getElementsByTagName("body")[0].innerHTML=e})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment