Skip to content

Instantly share code, notes, and snippets.

@ashtonkj

ashtonkj/SOWatch.js

Created Jul 29, 2014
Embed
What would you like to do?
Stack Overflow Chat - Check for New Users
javascript:function somethingChanged(changes) {
changes.forEach( function ( change, i ) {
$("#chat").append('<div class="user-container user-24793 monologue mine catchup-marker catchup-marker-2">
<a href="/users/24793/ashtonkj" class="signature user-24793">
<div class="tiny-signature">
<div class="avatar avatar-16">
<img width="16" height="16" src="http://cdn.sstatic.net/stackoverflow/img/logo.png?v=c4" alt="AshtonKJ" title="AshtonKJ">
</div>
<div class="username">The Room</div>
</div>
<div class="avatar avatar-32 clear-both" style="display: none;">
<img width="32" height="32" src="http://cdn.sstatic.net/stackoverflow/img/logo.png?v=c4" alt="AshtonKJ" title="AshtonKJ">
<div>
</div>
</div>
<div class="username" style="display: none;">The Room</div><div class="flair" title="878" style="display: none;">878</div>
</a><div class="messages"><div class="message" id="message-17980239"><a class="action-link" title="click for message actions" href="/transcript/message/17980239#17980239"><span class="img menu"> </span></a><div class="content">' + 'User: ' + change.object[change.name]['name'] + ' joined. </div><span class="meta"><span class="flags vote-count-container"><span class="img"></span><span class="times"></span></span>&nbsp;<span class="stars vote-count-container"><span class="img"></span><span class="times"></span></span></span><span class="flash"><span class="stars vote-count-container"><span class="img"></span><span class="times"></span></span></span></div></div><div class="clear-both" style="height: 0px;">&nbsp;</div>
</div>');
});
}
Object.observe(window.users, somethingChanged,['add']);
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.