Skip to content

Instantly share code, notes, and snippets.

@joeshaw
Created July 16, 2015 19:56
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 joeshaw/a9ef7aa60981d61a15ef to your computer and use it in GitHub Desktop.
Save joeshaw/a9ef7aa60981d61a15ef to your computer and use it in GitHub Desktop.
Using my shitty javascript skills to add Slack nicks to real names
function addNicks() {
$(".message_sender").map(function() {
var name = $(this).data("x-name");
if (!name) {
name = $(this).text();
$(this).data("x-name", name);
}
var href = $(this).attr("href");
if (href) {
var nick = href.slice(6);
$(this).text(name + " (@" + nick + ")");
}
});
}
// ugggghhhh
setInterval(addNicks, 250);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment