花了一点点时间,写了一个非常简单的油猴脚本,可以显示帖子回复用户的注册时间,希望在这个诸君情绪都不稳定的时代,给大家多一点的辨认信息。
// ==UserScript==
// @name Aparecium
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Shows User's create time in V2ex.
// @author FledgeShiu
// @copyright No License
// @match *://*.v2ex.com/t/*
// @match *://v2ex.com/t/*
// @icon https://v2ex.com/static/icon-192.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
async function run() {
let comment_nodes = document.querySelectorAll("div[id^=r_].cell");
comment_nodes.forEach(async function(node){
const user = node.querySelectorAll("tr>td:last-child")[0];
const user_info_url = user.querySelectorAll("strong>a")[0].href;
const user_name = user_info_url.split('/').at(-1);
const response = await fetch(`https://${window.location.host}/api/members/show.json?username=${user_name}`);
const jsonData = await response.json();
const date = new Date(jsonData.created * 1000).toLocaleDateString()
const age_element = user.getElementsByClassName("ago")[0];
const next_element = age_element.nextSibling
const empty_text = document.createTextNode('\u00A0 \u00A0');
user.insertBefore(empty_text, next_element);
let new_element = document.createElement("span");
new_element.innerHTML = date;
new_element.classList.add("ago");
user.insertBefore(new_element, next_element);
});
}
run()
})();
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.