rideride

response

May 20th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Response Times
  3. // @description Live Counting
  4. // @author /u/
  5. // @namespace none lol
  6. // @include *://*.reddit.com/live/*
  7. // @exclude *://*.reddit.com/live/create*
  8. // @exclude *://*.reddit.com/live/*/edit*
  9. // @exclude *://*.reddit.com/live/*/updates/*
  10. // @exclude *://*.reddit.com/live/*/contributors*
  11. // ==/UserScript==
  12.  
  13.  
  14.  
  15. (function () {
  16. 'use strict';
  17. // Setup variables
  18. var lc = $('.liveupdate-listing');
  19.  
  20.  
  21. lc.on('DOMNodeInserted', function (e) {
  22.  
  23. var $node = $(e.target);
  24. // Must be a .liveupdate element
  25. if (!$node.hasClass('liveupdate')) {
  26. return;
  27. } // Check that the new message is at the top
  28. // (Not loaded from bottom)
  29.  
  30. var index = $node.index();
  31. if (index != 0) {
  32. return;
  33. } // Color
  34.  
  35.  
  36. var magin = $node.find('.body').prev().attr('href');
  37. var magin2 = magin.replace('/live/ta535s1hq2je/updates/', '');
  38. var magin2p1 = magin2.substring(0, 8);
  39. var magin2p2 = parseInt(magin2p1, 16);
  40. var magin3 = $node.find('.body').parent().next().children().first().attr('href');
  41. var magin4 = magin3.replace('/live/ta535s1hq2je/updates/', '');
  42. var magin4p1 = magin4.substring(0, 8);
  43. var magin4p2 = parseInt(magin4p1, 16);
  44. var teenviopoemas = magin2p2 - magin4p2;
  45. var demipunoyletra = teenviopoemas / 10000;
  46. demipunoyletra = ~~demipunoyletra;
  47.  
  48.  
  49. $node.find('.river').css('position', 'absolute');
  50. $node.find('.body').prepend("<div id=river></div>");
  51. document.getElementById("river").innerHTML = demipunoyletra;
  52. $( 'div#river' ).css('position', 'absolute').css('margin-left', '-135px').css('font-size', '9px').css('margin-top', '4px').css('background-color', '#aeeeff').css('width','120px').css('text-align','right').css('max-width','120px');
  53.  
  54.  
  55.  
  56. });
  57. }) ();
Add Comment
Please, Sign In to add comment