Advertisement
Guest User

RU-Board WhosOnline

a guest
Dec 9th, 2013
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           RU-Board WhosOnline
  3. // @author         Zloy_Gelud
  4. // @namespace      http://userscripts.org/scripts/show/159445
  5. // @include        http*://forum.ru-board.com/topic.cgi?forum=*
  6. // @include        http*://forum.ru-board.com/forum.cgi?forum=bm*
  7. // @include        http*://72.233.112.78/topic.cgi?forum=*
  8. // @icon           http://forum.ru-board.com/favicon.ico
  9. // @description    Highlights users online
  10. // @require        http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  11. // @version        0.3
  12. // @run-at         document-end
  13. // ==/UserScript==
  14.  
  15. $(document).ready(function () {
  16.     $.ajax({
  17.         type: "GET",
  18.         url: "http://forum.ru-board.com/whosonline.cgi",
  19.         cache: false,
  20.         success: function (data) {
  21.             var Users = [];
  22.             var html = $.parseHTML(data);
  23.             $('tr.dats td:first-child b a', $(html)).each(function (col) {
  24.                 Users[$(this).html()] = true;
  25.             });
  26.             $('a.m b, tr[bgcolor="#FFFFFF"] td:last-child.dats>a', $(document)).each(function (user) {
  27.                 if (Users[$(this).html()]) {
  28.                     var img = $('<img>');
  29.                     img.attr({
  30.                         src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAABEElEQVR42mM49OggAxIWBGI1IDaFYjWoGFwNskJzIA4A4jQgLoXiNKiYOUwjTANIIBuIW4F4PhBvgeL5ULFsqBoGmOkgU1o33t1wuuZsxfuQfX5/Q3b5/q0+VvZ+4631p6GaQGoEGaDuBFk9H6R49rXp/4Hs/7vv7/o/9cyk/xV7S95DbQKpUWOAeg7k3i0he/3+Hnh44P/US1P/d57p+L/kyqL/vgtc/0KdB1JjiqIheIfv3613tvzvPtP1v/VU8/+5F2b995rhjKEB7qTKQ6Xvp56e+H/xlYX/Z1+Y+X/CoZ7/xStyMZwE9/SGm+tOV+wqfu892/mv5xTHv0XLct6vu7gGw9MkBytZEUd00gAARYOFZ55QF90AAAAASUVORK5CYII=",
  31.                         style: "position: relative; top: 3px; left: 2px"
  32.                     });
  33.                     img.appendTo($(this));
  34.                 } else {
  35.                     var img = $('<img>');
  36.                     img.attr({
  37.                         src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAUUlEQVR42m2N0QnAMAgFM0cG9Ts76Sr+Jy6guIDNC22h0I+Dxx1oI6K+GRu9we4NQ0TKzA7YcAgKkZkVEbXWQtA3QLr7JwxmPmLOWdjPqd/nF/ZXX3eu6yUJAAAAAElFTkSuQmCC",
  38.                         style: "position: relative; top: -1px; left: 4px"
  39.                     });
  40.                     img.appendTo($(this));
  41.                 }
  42.             });
  43.         }
  44.     });
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement