写了一个官方 clipper 的知乎回答剪藏模板(去除知乎 ai 链接,获取作者和发布时间)

具体代码如下,可以复制后导入到插件中:

知乎回答剪藏模板
{
  "schemaVersion": "0.1.0",
  "name": "知乎回答",
  "behavior": "create",
  "noteContentFormat": "{{contentHtml|replace:\"href=\\\"https\\://zhida\":\"\"|markdown}}",
  "properties": [
    {
      "name": "title",
      "value": "{{title|replace:\\\" - 知乎\\\":\\\"\\\"}}",
      "type": "text"
    },
    {
      "name": "source",
      "value": "{{url}}",
      "type": "text"
    },
    {
      "name": "author",
      "value": "{{selector:.UserLink-link|slice:1,2}}",
      "type": "text"
    },
    {
      "name": "published",
      "value": "{{selector:.ContentItem-time|split|date:\\\"YYYY-MM-DD\\\"}}",
      "type": "date"
    },
    {
      "name": "created",
      "value": "{{date}}",
      "type": "date"
    },
    {
      "name": "description",
      "value": "{{description}}",
      "type": "text"
    }
  ],
  "triggers": [
    "https://www.zhihu.com/question/*/answer"
  ],
  "noteNameFormat": "{{title|replace:\" - 知乎\":\"\"}}",
  "path": ""
}
3 个赞

老师,麻烦问下剪藏玩知乎,发布时间这里变成了这样,是我那里没设置对吗?

我也不知道怎么突然不好用了,试试这个。

知乎回答剪藏模板
{
  "schemaVersion": "0.1.0",
  "name": "知乎回答",
  "behavior": "create",
  "noteContentFormat": "{{selectorHtml:.RichContent-inner|first|replace:\"href=\\\"https\\://zhida\":\"\"|markdown}}",
  "properties": [
    {
      "name": "up",
      "value": "[[to read]]",
      "type": "text"
    },
    {
      "name": "title",
      "value": "{{title|replace:\\\" - 知乎\\\":\\\"\\\"}}",
      "type": "text"
    },
    {
      "name": "source",
      "value": "{{url}}",
      "type": "text"
    },
    {
      "name": "author",
      "value": "{{selector:.UserLink-link|slice:1,2}}",
      "type": "text"
    },
    {
      "name": "published",
      "value": "{{selector:.ContentItem-time|split:\\\",\\\"|first|split:\\\"发布于 \\\"|last|date:\\\"YYYY-MM-DD\\\"}}",
      "type": "date"
    },
    {
      "name": "created",
      "value": "{{date}}",
      "type": "date"
    },
    {
      "name": "description",
      "value": "{{description}}",
      "type": "text"
    }
  ],
  "triggers": [
    "/^https.+zhihu.+answer.+$/"
  ],
  "noteNameFormat": "{{title|replace:\" - 知乎\":\"\"}}",
  "path": "Clips"
}

老师,这一版无法剪藏网页内容 :joy:然后我把笔记内容里面的代码替换成第一版的这个{{contentHtml|replace:"href=\"https\://zhida":""|markdown}}就正常了

最后能用就好 :smiley: