Last active
August 29, 2015 14:06
-
-
Save rissole/2759a5def6af4b438e7e to your computer and use it in GitHub Desktop.
[Facebook Gags Collection]: *bad day* -> 'CAUSE YOU HAD A BAD DAY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Facebook Gags: bad day | |
// @namespace gags | |
// @description *bad day* -> 'CAUSE YOU HAD A BAD DAY | |
// @include https://www.facebook.com/ | |
// @include https://www.facebook.com/?* | |
// @require http://pastebin.com/raw.php?i=2GyZd2Dy | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var SOUND_SRC = "https://dl.dropboxusercontent.com/u/84590655/badday.ogg"; | |
function playSound() { | |
var sound = document.getElementById("facebook_gags_badday"); | |
if (sound === null) { | |
sound = document.createElement("audio"); | |
sound.src = SOUND_SRC; | |
sound.id = "facebook_gags_badday"; | |
document.body.appendChild(sound); | |
} | |
sound.play(); | |
} | |
addMessageHook(function(msg, currentUser) { | |
if (msg.body.indexOf("*bad day*") > -1) { | |
playSound(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment