Etherscan EasyRead

change timestamp on etherscan, make it easier to be analysised.

  1. // ==UserScript==
  2. // @name Etherscan EasyRead
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  5. // @description change timestamp on etherscan, make it easier to be analysised.
  6. // @author verazuo
  7. // @match https://etherscan.io/address/*
  8. // @match https://etherscan.io/txs?*
  9. // @match https://etherscan.io/txsInternal?*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var t;
  16. if (window.location.href.match("https://etherscan.io/address/")){
  17. t = document.getElementById("transactions");
  18. } else if (window.location.href.match("https://etherscan.io/txsInternal?")){
  19. t = document.getElementsByClassName("card-body")[0];
  20. } else if (window.location.href.match("https://etherscan.io/txs?")){
  21. t = document.getElementById("ContentPlaceHolder1_mainrow");
  22. }
  23.  
  24. var trs = t.getElementsByTagName('tr');
  25.  
  26. for (var i=1;i<trs.length;i++)
  27. {
  28. var tr = trs[i].getElementsByTagName("td");
  29. if(tr.length < 3){
  30. continue;
  31. }
  32. var span;
  33. if (window.location.href.match("https://etherscan.io/txsInternal?")){
  34. span = tr[1].getElementsByTagName("span")[0];
  35. } else {
  36. span = tr[2].getElementsByTagName("span")[0];
  37. }
  38. if (span === undefined){
  39. continue;
  40. }
  41. var date = new Date(span.title);
  42. var myDate = date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2) + " " + ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2)+ ":" + ("0" + date.getSeconds()).slice(-2);
  43. span.innerHTML=myDate;
  44. }
  45. })();