Advertisement
erinx

special scoots

May 22nd, 2015
740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Scootaloo is special
  3. // @namespace   erin
  4. // @description pinkify scoots
  5. // @include     *//8ch.net/animus/*
  6. // @version     1
  7. // @grant       none
  8. // @run-at document-end
  9. // ==/UserScript==
  10.  
  11. function pinkScoot(){
  12.  
  13.   var d, db, $, $$;
  14.  
  15.   d = document;
  16.   db = document.body;
  17.  
  18.   $ = function(s, p){
  19.     if(!p || p == null){
  20.       p = db;
  21.     }
  22.     return p.querySelector(s);
  23.   };
  24.  
  25.   $$ = function(s, p){
  26.     if(!p || p == null){
  27.       p = db;
  28.     }
  29.     return p.querySelectorAll(s);
  30.   };
  31.  
  32.   $.each = function(a, c, e){
  33.     for(var i = 0; i < a.length; i++){
  34.       c(a[i], i);
  35.       if(i == (a.length)-1){
  36.         if(e && e != null){
  37.           return e(a[i], i);
  38.         }else{
  39.           return a;
  40.         }
  41.       }
  42.     }
  43.   };
  44.  
  45.   $.time = function(t, c, l){
  46.     if(c == false){
  47.       return clearInterval(t);
  48.     }else{
  49.       if(l == true){
  50.         return setInterval(function(){
  51.           c();
  52.         },t);
  53.       }else{
  54.         return setTimeout(function(){
  55.           c();
  56.         },t);
  57.       }
  58.     }
  59.   };
  60.  
  61.   function makePink(){
  62.       $.each($$('.reply'), function(post, xi){
  63.         if($('.trip', post)){
  64.           if($('.trip', post).innerHTML == '!DScooTaloo'){
  65.             $('.trip', post).style.color = '#ff0bc3';
  66.             $('.name', post).style.color = '#ff0bc3';        
  67.           }  
  68.         }
  69.       });
  70.   }
  71.  
  72.   makePink();
  73.   $.time(1500, function(){ makePink(); }, false);
  74.   d.addEventListener('8chan-Z.NewPosts', function(){ makePink(); $.time(1500, function(){ makePink(); }, false); }, false);
  75.   d.addEventListener('threadUpdate', function(){ makePink(); $.time(1500, function(){ makePink(); }, false); }, false);
  76.   d.addEventListener('new_post', function(){ makePink(); $.time(1500, function(){  makePink(); }, false); }, false);
  77.  
  78.  
  79. }
  80.  
  81. pinkScoot();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement