Created
July 23, 2015 11:18
-
-
Save shu8/e96e44fe1e7f41eb22e7 to your computer and use it in GitHub Desktop.
Adds a tooltip to the 'modified'/'answered' parts of questions on the homepage that tells you when the question was asked.
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 Get asked date | |
// @namespace http://stackexchange.com/users/4337810/ | |
// @version 1.0 | |
// @description Adds a tooltip to the 'modified'/'answered' parts of questions on the homepage that tells you when the question was asked. | |
// @author ᔕᖺᘎᕊ (http://stackexchange.com/users/4337810/) | |
// @match *://*.stackexchange.com/* | |
// @match *://*.stackoverflow.com/* | |
// @match *://*.superuser.com/* | |
// @match *://*.serverfault.com/* | |
// @match *://*.askubuntu.com/* | |
// @match *://*.stackapps.com/* | |
// @match *://*.mathoverflow.net/* | |
// @grant none | |
// ==/UserScript== | |
function getDate(url, $that) { | |
$.get(url, function(responseText, textStatus, XMLHttpRequest) { | |
$that.find('.shub-asked-date').attr('title', $(XMLHttpRequest.responseText).find('#question > table > tbody > tr:nth-child(1) > td.postcell > div > table > tbody > tr > td.post-signature.owner > div > div.user-action-time').text().trim()); | |
}); | |
} | |
$('.started').each(function() { | |
$that = $(this); | |
$(this).find('a:eq(0)').wrapInner("<span class='shub-asked-date'></span>"); | |
getDate($(this).parent().parent().find('h3 a').attr('href'), $that); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://meta.stackexchange.com/a/261242/260841