Created
July 16, 2015 18:39
-
-
Save lsloan/3c4b8734276af859d84b to your computer and use it in GitHub Desktop.
Replace RequestBin's relative times with absolute ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('div.span2 span').each(function() { | |
$span = $(this); | |
$span.text($span.attr('title')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RequestBin shows relative timestamps on the requests that it's received, like "7s ago", "15m ago", "2h ago", "1d ago", etc. Those are nice, but if you refresh the page expecting to see new content, but there isn't any, it takes a while to realize that the request with the "3m ago" time is the same one that had "1m ago" just a little while earlier. If they would show the absolute timestamp, changes would be noticed easier.
Fortunately, in their HTML, RequestBin wraps the relative timestamps with span elements that have the absolute timestamp in their title attributes. Therefore, I worked out this quick jQuery operation to find all of those elements and replace their text with the value from their title attributes. It could use a little work, though. It may be better to have both the absolute and relative times shown together. It would also be nice to not have the direct links for the requests overwritten.
To make this the most useful, it could be put into a bookmarklet to be run whenever the user chooses. It could also be put into a userscript, executed by TamperMonkey or GreaseMonkey every time the page loads.