Last active
April 18, 2016 14:54
-
-
Save AleksueiR/8d73dc4bb9e8987fd4b1282d648c6128 to your computer and use it in GitHub Desktop.
This file contains 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
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author You | |
// @match http*://github.com/* | |
// @grant none | |
// @require https://code.jquery.com/jquery-2.2.3.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
window.setInterval(function() { | |
var timestamps = $('.timestamp[href^="#zh"] > time:not(.tm-parsed)'); | |
timestamps.each(function(index, ts) { | |
ts = $(ts); | |
var value = moment(ts.attr('datetime')).fromNow(); | |
var titleValue = moment(ts.attr('datetime')).format('MMM DD, YYYY, hh:mm A') + ' EDT'; | |
ts.attr('title', titleValue); | |
ts.text(value); | |
ts.addClass('tm-parsed'); | |
// console.log(value); | |
}); | |
}, 3000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment