Advertisement
Guest User

Spam auto-ping

a guest
Mar 25th, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var b = new Audio('http://cdn-chat.sstatic.net/chat/meta2.mp3');
  2. var e = /spam|\/smokedetector|low quality|offensive/i;
  3. var h = /http/i;
  4.  
  5. var path = window.location.pathname.split('/');
  6. if (path[1] == 'rooms' && path[2] == '89') {
  7.   f();
  8. }
  9.  
  10. function f() {
  11.   var i, t;
  12.   var a = document.getElementsByClassName('message');
  13.   var m = a[a.length-1];
  14.   if (m && !m.classList.contains('c')) {
  15.     m.classList.add('c');
  16.     if (m.children[1] && !m.parentNode.parentNode.classList.contains('mine')) {
  17.       t = m.children[1].innerHTML;
  18.       if (e.test(t) && h.test(t)) {
  19.         b.play();
  20.       }
  21.     }
  22.   }
  23.   window.setTimeout(f,500);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement