-
在@aoout佬的这个脚本基础上修改:写了一个官方 clipper 的知乎回答剪藏模板(去除知乎 ai 链接,获取作者和发布时间)
-
主要增加两个功能点:
- 使用CSS选择器,剔除掉所有无关的内容比如多少人赞同、更多回答。专注于回答的内容本身
- 使用CSS选择器,获取回答的发布时间,添加进属性变量
- 使用CSS选择器,获取回答的赞同数量,添加进属性变量
- 使用replace,替换掉标题中偶尔出现的(X封私信)
-
以下是配置JSON代码:
{
"schemaVersion": "0.1.0",
"name": "知乎回答 (2)",
"behavior": "create",
"noteContentFormat": "{{selectorHtml:.QuestionAnswer-content .RichText|markdown}}",
"properties": [
{
"name": "source",
"value": "{{url}}",
"type": "text"
},
{
"name": "author",
"value": "{{selector:.UserLink-link|slice:1,2}}",
"type": "multitext"
},
{
"name": "publicTime",
"value": "{{selector:.QuestionAnswer-content .ContentItem-time span}}",
"type": "text"
},
{
"name": "agreeCount",
"value": "{{selector:.RichContent-actions .VoteButton--up}}",
"type": "text"
}
],
"triggers": [
"https://www.zhihu.com/question/*/answer"
],
"noteNameFormat": "{{title|replace:\" - 知乎\":\"\"|replace:\"/\\(\\d+\\s*封私信\\)/g\":\"\"}}",
"path": "Clippings"
}
-
上面配置的导入方式:
新用户只能上传一幅图,自己找吧( -
效果展示图,原文章地址: