-
-
Save cairdcoinheringaahing/65f108470c4cf41abbecaed882f9c9d0 to your computer and use it in GitHub Desktop.
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 Chat Commands | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3.0 | |
// @description Add some simple ascii art commands. | |
// @author Teh Flamin' Taco | |
// @include *://chat.meta.stackoverflow.com/rooms/* | |
// @include *://chat.meta.stackexchange.com/rooms/* | |
// @include *://chat.stackexchange.com/rooms/* | |
// @include *://chat.stackoverflow.com/rooms/* | |
// @include *://chat.askubuntu.com/rooms/* | |
// @include *://chat.serverfault.com/rooms/* | |
// @updateURL https://rawgit.com/TehFlaminTaco/TacosUserscripts/blob/master/chatcommands.user.js | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var codes = { | |
shrug: "¯\\\\_(ツ)_/¯", | |
tableflip: "(ノ°Д°)ノ︵ ┻━┻", | |
"o(_+)o": "ಠ$1ಠ", | |
disapprove: "ಠ_ಠ", | |
like: "\\(•◡•)/", | |
unflip: "┬─┬ ノ( ゜-゜ノ)", | |
why: "ლ(ಠ益ಠლ)", | |
sunglasses: '(•_•) / ( •_•)>⌐■-■ / (⌐■_■)', | |
strike: '`---strikethrough---` ---strikethrough---', | |
rickroll: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', | |
userscripts: 'https://github.com/RedwolfPrograms/userscripts https://github.com/TehFlaminTaco/TacosUserscripts', | |
rscripts: 'https://github.com/RedwolfPrograms/userscripts', | |
tscripts: 'https://github.com/TehFlaminTaco/TacosUserscripts', | |
acronyms: 'https://codegolf.meta.stackexchange.com/questions/12537/what-are-our-specific-abbreviations-and-terms', | |
sandbox: 'https://codegolf.meta.stackexchange.com/questions/2140/sandbox-for-proposed-challenges', | |
iodefaults: 'https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods', | |
welcome: 'https://codegolf.meta.stackexchange.com/questions/20861/welcome-to-code-golf-and-coding-challenges-stack-exchange', | |
tio: 'https://tio.run', | |
jelly: 'https://tio.run/#jelly', | |
}; | |
setInterval(function() { | |
var x; | |
for (var code in codes) { | |
x = document.getElementById("input"); | |
x.value = x.value.replace(new RegExp("(?:\\s|^)/" + code), function(m){ | |
var s = m.match(/^(\s*)\/(.*)/) | |
return s[1]+s[2].replace(new RegExp(code), codes[code]) | |
}); | |
} | |
}, 300); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment