Skip to content

Instantly share code, notes, and snippets.

@rissole rissole/fbg_badday.user.js
Last active Aug 29, 2015

Embed
What would you like to do?
[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
You can’t perform that action at this time.