Skip to content

Instantly share code, notes, and snippets.

@rissole
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rissole/2759a5def6af4b438e7e to your computer and use it in GitHub Desktop.
Save rissole/2759a5def6af4b438e7e to your computer and use it in GitHub Desktop.
[Facebook Gags Collection]: *bad day* -> 'CAUSE YOU HAD A BAD DAY
// ==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