谨慎请教,这应该怎么加入浏览器啊?
应该不会
试试这个
哇,非常感谢,,原来鼎鼎有名的油猴,,以前稀里糊涂的装过
非常感谢,,真是宝藏无限啊,,,感激!
可以了,不错,每个回答下面的评论是不是就是无法显示准确时间啊?
多谢,您装的是Tampermonkey吗?直觉感觉这个似乎比油猴做的更专业易用一点,以前装油猴都不记得因为什么了,不是看到这个贴子甚至都忘记了!
哈哈,此刻好像是已经正常了,难道这么慢吗?还是又是那个货干的
“问题”、“直达问题”、“文章”、“创建时间”、“最后编辑”。。。
哇,果然清爽多了…
但是手机端特供了“来自其他问题的回答”这种狗屎设计
真的是被人启发,原来我有这种需求……非常感谢,知乎体验提升一大截
2023-12-10知乎修改了一些标签的"class",导致文字重叠在一起了。
我改了一下脚本,(基本)解决了文字重叠的问题。
// ==UserScript==
// @name 知乎评论时间精确到秒
// @namespace http://tampermonkey.net/
// @version 0.4
// @description try to take over the world!
// @author You
// @match https://www.zhihu.com/*
// @match https://zhuanlan.zhihu.com/*
// @icon http://zhihu.com/favicon.ico
// @grant GM_addStyle
// @run-at document-start
// @require https://scriptcat.org/lib/637/1.3.3/ajaxHooker.js
// ==/UserScript==
(function () {
'use strict';
function timestampToTime(timestamp) {
const milliseconds = timestamp * 1000;
const date = new Date(milliseconds);
const year = date.getFullYear();
const month = addZero(date.getMonth() + 1);
const day = addZero(date.getDate());
const hour = addZero(date.getHours());
const minute = addZero(date.getMinutes());
const second = addZero(date.getSeconds());
return `${ year }-${ month }-${ day } ${ hour }:${ minute }:${ second }`;
}
function addZero(num) {
return num < 10 ? `0${ num }` : `${ num }`;
}
ajaxHooker.hook(request => {
if (request.url.includes("https://www.zhihu.com/api/v4/comment_v5/comment/") || request.url.includes("https://www.zhihu.com/api/v4/comment_v5/answers/") || request.url.includes("https://www.zhihu.com/api/v4/comment_v5/articles/")) {
request.response = res => {
// console.log('\n== ↓ ↓ ↓ ↓ ↓ == \n', res)
if (res.json.data) {
res.json.data.forEach(item => {
// console.log(timestampToTime(item.created_time));
item.content = item.content + '<span class="commentTime">' + timestampToTime(item.created_time) + '</span>'
if (item.child_comments.length >= 1) {
item.child_comments.forEach(child => {
child.content = child.content + '<span class="commentTime">' + timestampToTime(child.created_time) + '</<span>'
});
}
});
GM_addStyle(`
.CommentContent {
position: relative;
overflow: visible;
}
/* 精确时间 */
.commentTime {
position: absolute;
left: 0;
bottom: -25px;
color: #999;
}
.css-140jo2 {
position: relative;
}
/* 原时间 */
.css-12cl38p,
.css-12cl38p + span,
.css-nm6sok + span {
display: none;
}
/* ip属地 */
span.css-ntkn7q {
position: absolute;
left: 160px;
top: 3px;
}
/* 热评 */
span.css-1kq4cxq {
position: absolute;
left: 240px;
top: 3px;
}
/* 作者置顶 */
.css-1o87v1m{
position: absolute;
top: 22px;
left: -4px;
}
`);
}
};
}
});
})();
这方面做到极致的是小红书。
没有时间排序,也没有热度排序,更没有楼层显示
个人觉得这样方便操作舆论,水军评论放前面,不利评论删掉什么的,用户感知度很低
score看起来是分数,估计是点赞数之类的高价值回答,ts应该跟time有关,也就是时间顺序排列
嗯,之前看到过那种截图,两个不同的男女账号,看到的评论不一样
谢谢提醒及修正
补充下,如果遇到,时间、IP等显示位置错乱,可以尝试按下 Ctrl + shift + C
后点击时间、IP等进行定位,比如 html 标签class="foo"
、id="bar"
对应的 css 代码为.foo{}
、#bar{}
时间、IP等显示位置可通过修改脚本中left、top、right、bottom
px 值来调整
/* ip属地 */
span.css-ntkn7q {
position: absolute;
left: 160px;
top: 3px;
}
小红书玩的少,不知道有没有类似b站那种阿瓦隆
控评系统,看介绍好像是 21 年出的,前几个月才发现,也挺逆天,联网玩成单机
确实,ts 可能是 timestamp 时间戳
最近知乎做了些调整,我更新了一版发布到greasyfork上了。
后边有问题可以联系我修改,直接从greayfork上更新
讲真,知乎真的越来越不好用,懂不懂就推视频,搜索问题出来一个视频,要不然就是一大堆需要开会员才能看的文章。。