CCC.hn date

Shows when the post and comments have been added to the forum

当前为 2014-11-16 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         CCC.hn date
// @namespace    http://ccc.hn/user/3700-xorg/
// @version      0.2
// @description  Shows when the post and comments have been added to the forum
// @author       xorg
// @match        http://ccc.hn/topic/*
// ==/UserScript==

source = document.body.innerHTML;
tmp = source.match(/<!--[\s\S]*?-->/g);
dates = [];
for (var i = 0; i < tmp.length; i++) 
	if (tmp[i].indexOf('cached') + 1)
	{
		date = tmp[i].slice(16, -9);
		date = date.substr(0, 12) + (parseInt(date.substr(12, 2)) + 3) + date.substr(14);
		dates.push(date);
	}
k = 0;
allLink = document.getElementsByTagName('a');
for (var i = 0; i < allLink.length; i++)
    if ((allLink[i].innerHTML.indexOf('#') + 1) && (allLink[i].href.indexOf('#entry') + 1))
    {
        allLink[i].innerHTML += dates[k];
        k++;
    }