gavin19

Reddit - Change user/inbox comments timestamp

Sep 24th, 2011
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Reddit - Change user/inbox comments timestamp
  3. // @author        gavin19
  4. // @description   Change timestamp on user pages to show local time instead of '2 weeks ago..'
  5. // @match         http://*.reddit.com/user/*
  6. // @match         https://*.reddit.com/user/*
  7. // @include        http://*.reddit.com/user/*
  8. // @include        https://*.reddit.com/user/*
  9. // @version       1.00
  10. // ==/UserScript==
  11.  
  12.  function replaceTimes() {
  13.         var timeS = document.querySelectorAll('p.tagline time');
  14.         var tagLines = document.querySelectorAll('p.tagline');
  15.         for (var i = 0,leni=timeS.length; i < leni; i++) {
  16.         timeS[i].innerHTML = timeS[i].getAttribute('title');
  17.         };
  18.         for (var j = 0,lenj=tagLines.length; j <lenj ; j++) {
  19.         tagLines[j].innerHTML = tagLines[j].innerHTML.replace("ago", "");
  20.         };
  21.     };
  22.     };
  23.     replaceTimes();
Add Comment
Please, Sign In to add comment