[
  {
    "path": ".gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto\n"
  },
  {
    "path": ".gitignore",
    "content": "\n.DS_Store\ndev.html\ndevblacklist.json\n"
  },
  {
    "path": "Advanced.md",
    "content": "## 高级技巧\n\n以下都是可选变量，如果能正常运行，可以不填写。添加方式就是在填写key的那一段代码的`</script>`之前添加即可。\n\n![](/img/advanced.png)\n\n例如：`<script>let tianliGPT_wordLimit = 2000; let tianliGPT_postURL = '*/p/*'; let tianliGPT_postSelector = '\\#article-container';let tianliGPT_key = '这是你的key';</script>`\n\n### tianliGPT_postURL\n\n当主题存在其他页面和文章页面结构相同时，可以通过通配符url域名来实现只在指定域名中执行。\n\n例如：`let tianliGPT_postURL = '*/p/*';`\n\n只会在地址含有`/p/`的域名中执行。避免非文章页面添加。\n\n### tianliGPT_wordLimit\n\n⚠️危险：更改此变量损失已消耗过的key，因为你提交的内容发生了变化。\n\n可以设置提交的字数限制，默认为1000字。这意味着每个文章最多消耗你1000字符（因为只有提交扣费，生成文本不扣费）。你可以降低字符数来让扣费变得更少，也可以增加字符数让文章变得更准确。上限为5000，超过5000字符将被截断。\n\n例如：`let tianliGPT_wordLimit = 1000;`\n\n### tianliGPT_typingAnimate\n\n当此变量为false时，那么不执行打字动画。\n\n例如：`let tianliGPT_typingAnimate = false;`\n\n### tianliGPT_Title\n\n当设置此变量后，TianGPT顶部的名称“AI摘要”可以被修改。\n\n例如：`let tianliGPT_Title = '宇宙无敌智能摘要';`"
  },
  {
    "path": "LICENSE",
    "content": "禁止用于其他项目的商业用途，仅限TianLIGPT使用。\n允许个人用途的修改和优化。\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n    <a href=\"https://summary.zhheo.com/\" target=\"_blank\" rel=\"noopener noreferrer\">\n        <img src=\"/img/st.jpg\" alt=\"icon\"/>\n    </a>\n    <h1 align=\"center\">文章摘要</h1>\n    <span>适用于绝大多数博客的文章摘要生成器</span>\n    <br>\n    <a href=\"https://flowus.cn/zhheo/share/3d6d616b-e183-436e-8e3e-2b177f99e941\">官方文档</a> · <a href=\"https://summary.zhheo.com/\">管理后台</a>\n</div>\n\n![](/img/workflows.png)\n\n**目前使用文章摘要的最佳实践是使用PostChat插件。对于只使用文章摘要的用户，请关闭PostChat的智能对话功能即可。**\n\n插件安装地址：https://postchat.zhheo.com/plugin/\n\n## 什么是TianliGPT\n\nTianliGPT是一个专业的文字摘要生成工具，你可以将需要提取摘要的文本内容发送给TianliGPT，稍等一会他就可以给你发送一个基于这段文本内容的摘要。\n\n- 实时生成的摘要\n- 自动生成，无需人工干预\n- 一次生成，再次生成无需消耗key\n- 包含文字审核过滤，适用于中国大陆\n- 支持中国大陆访问\n\n## 如何部署TianliGPT\n\n我们可以通过在网页中嵌入TianliGPT的服务支持，让TianliGPT能够获取到你需要提交的内容。\n\n1. 你需要在博客后面位置引入js和css（**引入在网站的任意位置**）\n\n```html\n<link rel=\"stylesheet\" href=\"https://ai.tianli0.top/static/public/tianli_gpt.min.css\">\n<script>\nlet tianliGPT_postSelector = '#post #article-container';\nlet tianliGPT_key = '5Q5mpqRK5DkwT1X9Gi5e';\n</script>\n<script src=\"https://ai.tianli0.top/static/public/tianli_gpt.min.js\"></script>\n```\n\n2. 我们需要更改一些参数来让这个模型运作起来。\n\n`tianliGPT_postSelector`和`tianliGPT_key`\n\n### tianliGPT_postSelector\n\n这个参数是填写你的博客文章所在的元素属性的选择器，在生成提交的文本时，只会将这个选择器对应的元素内的文本进行提交，并且在这个选择器对应的元素上放插入AI摘要。如果你使用的是Butterfly主题，那么为`#post #article-container`。\n\n这里列出一些常见博客主题的选择器值（部分未经过测试，如果有问题欢迎反馈）：\n\n[查看主题适配文档](https://postsummary.zhheo.com/install.html)\n\n如果你没有在上面看到你的主题，查看[通用教程](https://flowus.cn/zhheo/7a353126-f225-4e5c-8c11-f5adefe85b7f)，手把手教你如何使用前端选择器。\n\n**如果你写了你的主题适配教程，欢迎在issues里投稿，我会收录到官方文档中，帮助更多的小伙伴搭建。**\n\n### tianliGPT_key\n\n到[爱发电](https://store.zhheo.com?cid=1&mid=3)中购买，10元5万字符（限时折扣9元）。请求过的内容再次请求不会消耗key，可以无限期使用。\n\n- 相比实时请求openai，使用tianliGPT可以让你请求过的内容不再消耗key，适合生产环境。\n- 相比实时请求openai，使用tianliGPT可以在国内更快速的获取摘要。\n- 符合中国大陆法律法规。\n- key消耗完毕，已经请求过的内容仍然可以继续请求，避免了被恶意请求造成的资金损失和业务停摆。\n\n购买完成后，进入管理后台：https://summary.zhheo.com/\n\n登录后点击右上角的“添加新网站”，输入密钥即可\n\n即可绑定成功。\n\n## 高级技巧\n\n更多的参数变量详见[高级文档](https://postsummary.zhheo.com/parameters.html)\n\n例如关闭文字动画、限制每次提交最大字数等。\n\n## 开发团队\n\n后端开发：[@Tianli](https://github.com/Tianli0)\n\n产品设计与前端开发：[@张洪Heo](https://github.com/zhheo)\n\n## 技术支持请联系\n\nzhheo@qq.com\n\n点击链接加入讨论子频道【TianliGPT 问题交流】：https://pd.qq.com/s/7cx85i9l0\n\n针对此项目的任何技术支持与关于API的相关问题，可以联系此邮箱，会在24小时内回复。\n\n## 更多支持TianliGPT的项目\n\n[Post-Summary-AI](https://github.com/qxchuckle/Post-Summary-AI) - 轻笑开发的博客摘要生成工具\n\n[hexo-ai-excerpt](https://github.com/rootlexblog/hexo-ai-excerpt) - 在本地部署时添加AI摘要\n\n# vitepress\n\nnpm run docs:build\n\nnpm run docs:dev\n\n## 赞助\n\n本项目 CDN 加速及安全防护由 [Tencent EdgeOne](https://edgeone.ai/zh?from=github) 赞助\n\n![34fe3a45-492d-4ea4-ae5d-ea1087ca7b4b](https://github.com/user-attachments/assets/0f3da64f-9e35-4118-9286-7ad46e753604)\n\n"
  },
  {
    "path": "custom/README.md",
    "content": "# 定制JS\n\n部分主题不兼容本项目，所以需要定制js。\n\n## Siuyo/Ying\n\njs代码替换为：\n\n`<script src=\"https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.18/custom/Siuyo-Ying.js\"></script>`\n"
  },
  {
    "path": "custom/Siuyo-Ying.js",
    "content": "console.log(\"\\n %c Post-Abstract-AI 开源博客文章摘要AI生成工具 %c https://github.com/zhheo/Post-Abstract-AI \\n\", \"color: #fadfa3; background: #030307; padding:5px 0;\", \"background: #fadfa3; padding:5px 0;\")\n\nfunction insertAIDiv(selector) {\n  // 首先移除现有的 \"post-TianliGPT\" 类元素（如果有的话）\n  removeExistingAIDiv();\n  \n  // 获取目标元素\n  const targetElement = document.querySelector(selector);\n\n  // 如果没有找到目标元素，不执行任何操作\n  if (!targetElement) {\n    return;\n  }\n\n  // 创建要插入的HTML元素\n  const aiDiv = document.createElement('div');\n  aiDiv.className = 'post-TianliGPT';\n\n  const aiTitleDiv = document.createElement('div');\n  aiTitleDiv.className = 'tianliGPT-title';\n  aiDiv.appendChild(aiTitleDiv);\n\n  const aiIcon = document.createElement('i');\n  aiIcon.className = 'tianliGPT-title-icon';\n  aiTitleDiv.appendChild(aiIcon);\n\n  // 插入 SVG 图标\n  aiIcon.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\">\n  <title>机器人</title>\n  <g id=\"&#x673A;&#x5668;&#x4EBA;\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n    <path d=\"M34.717885,5.03561087 C36.12744,5.27055371 37.079755,6.60373651 36.84481,8.0132786 L35.7944,14.3153359 L38.375,14.3153359 C43.138415,14.3153359 47,18.1768855 47,22.9402569 L47,34.4401516 C47,39.203523 43.138415,43.0650727 38.375,43.0650727 L9.625,43.0650727 C4.861585,43.0650727 1,39.203523 1,34.4401516 L1,22.9402569 C1,18.1768855 4.861585,14.3153359 9.625,14.3153359 L12.2056,14.3153359 L11.15519,8.0132786 C10.920245,6.60373651 11.87256,5.27055371 13.282115,5.03561087 C14.69167,4.80066802 16.024865,5.7529743 16.25981,7.16251639 L17.40981,14.0624532 C17.423955,14.1470924 17.43373,14.2315017 17.43948,14.3153359 L30.56052,14.3153359 C30.56627,14.2313867 30.576045,14.1470924 30.59019,14.0624532 L31.74019,7.16251639 C31.975135,5.7529743 33.30833,4.80066802 34.717885,5.03561087 Z M38.375,19.4902885 L9.625,19.4902885 C7.719565,19.4902885 6.175,21.0348394 6.175,22.9402569 L6.175,34.4401516 C6.175,36.3455692 7.719565,37.89012 9.625,37.89012 L38.375,37.89012 C40.280435,37.89012 41.825,36.3455692 41.825,34.4401516 L41.825,22.9402569 C41.825,21.0348394 40.280435,19.4902885 38.375,19.4902885 Z M14.8575,23.802749 C16.28649,23.802749 17.445,24.9612484 17.445,26.3902253 L17.445,28.6902043 C17.445,30.1191812 16.28649,31.2776806 14.8575,31.2776806 C13.42851,31.2776806 12.27,30.1191812 12.27,28.6902043 L12.27,26.3902253 C12.27,24.9612484 13.42851,23.802749 14.8575,23.802749 Z M33.1425,23.802749 C34.57149,23.802749 35.73,24.9612484 35.73,26.3902253 L35.73,28.6902043 C35.73,30.1191812 34.57149,31.2776806 33.1425,31.2776806 C31.71351,31.2776806 30.555,30.1191812 30.555,28.6902043 L30.555,26.3902253 C30.555,24.9612484 31.71351,23.802749 33.1425,23.802749 Z\" id=\"&#x5F62;&#x72B6;&#x7ED3;&#x5408;\" fill=\"#444444\" fill-rule=\"nonzero\"></path>\n  </g>\n  </svg>`\n\n  const aiTitleTextDiv = document.createElement('div');\n  aiTitleTextDiv.className = 'tianliGPT-title-text';\n  aiTitleTextDiv.textContent = 'AI摘要';\n  aiTitleDiv.appendChild(aiTitleTextDiv);\n\n  const aiTagDiv = document.createElement('div');\n  aiTagDiv.className = 'tianliGPT-tag';\n  aiTagDiv.id = 'tianliGPT-tag';\n  aiTagDiv.textContent = 'TianliGPT';\n  aiTitleDiv.appendChild(aiTagDiv);\n\n  const aiExplanationDiv = document.createElement('div');\n  aiExplanationDiv.className = 'tianliGPT-explanation';\n  aiExplanationDiv.innerHTML = '生成中...' + '<span class=\"blinking-cursor\"></span>';\n  aiDiv.appendChild(aiExplanationDiv); // 将 tianliGPT-explanation 插入到 aiDiv，而不是 aiTitleDiv\n\n  // 将创建的元素插入到目标元素的顶部\n  targetElement.insertBefore(aiDiv, targetElement.firstChild);\n}\n\nfunction removeExistingAIDiv() {\n  // 查找具有 \"post-TianliGPT\" 类的元素\n  const existingAIDiv = document.querySelector(\".post-TianliGPT\");\n\n  // 如果找到了这个元素，就从其父元素中删除它\n  if (existingAIDiv) {\n    existingAIDiv.parentElement.removeChild(existingAIDiv);\n  }\n}\n\nvar tianliGPT = {\n  //读取文章中的所有文本\n  getTitleAndContent: function() {\n    try {\n      const title = document.title;\n      const container = document.querySelector(tianliGPT_postSelector);\n      if (!container) {\n        console.warn('TianliGPT：找不到文章容器。请尝试将引入的代码放入到文章容器之后。如果本身没有打算使用摘要功能可以忽略此提示。');\n        return '';\n      }\n      const paragraphs = container.getElementsByTagName('p');\n      const headings = container.querySelectorAll('h1, h2, h3, h4, h5');\n      let content = '';\n  \n      for (let h of headings) {\n        if (h.closest('#comments')) continue;\n        content += h.innerText + ' ';\n      }\n  \n      for (let p of paragraphs) {\n        if (p.closest('#comments')) continue;\n        // 移除包含'http'的链接\n        const filteredText = p.innerText.replace(/https?:\\/\\/[^\\s]+/g, '');\n        content += filteredText;\n      }\n  \n      const combinedText = title + ' ' + content;\n      let wordLimit = 1000;\n      if (typeof tianliGPT_wordLimit !== \"undefined\") {\n        wordLimit = tianliGPT_wordLimit;\n      }\n      const truncatedText = combinedText.slice(0, wordLimit);\n      return truncatedText;\n    } catch (e) {\n      console.error('TianliGPT错误：可能由于一个或多个错误导致没有正常运行，原因出在获取文章容器中的内容失败，或者可能是在文章转换过程中失败。', e);\n      return '';\n    }\n  },\n  \n  fetchTianliGPT: async function(content) {\n    if (!tianliGPT_key) {\n      return \"没有获取到key，代码可能没有安装正确。如果你需要在tianli_gpt文件引用前定义tianliGPT_key变量。详细请查看文档。\";\n    }\n\n    if (tianliGPT_key === \"5Q5mpqRK5DkwT1X9Gi5e\") {\n      return \"请购买 key 使用，如果你能看到此条内容，则说明代码安装正确。\";\n    }\n\n    const apiUrl = `https://summary.tianli0.top/?content=${encodeURIComponent(content)}&key=${encodeURIComponent(tianliGPT_key)}`;\n    const timeout = 20000; // 设置超时时间（毫秒）\n  \n    try {\n        const controller = new AbortController();\n        const timeoutId = setTimeout(() => controller.abort(), timeout);\n        const response = await fetch(apiUrl, { signal: controller.signal });\n        if (response.ok) {\n            const data = await response.json();\n            return data.summary;\n        } else {\n            throw new Error('请求失败');\n        }\n    } catch (error) {\n        if (error.name === 'AbortError') {\n            if (window.location.hostname === 'localhost') {\n                console.warn('警告：请勿在本地主机上测试 API 密钥。');\n                return '获取文章摘要超时。请勿在本地主机上测试 API 密钥。';\n            } else {\n                console.error('请求超时');\n                return '获取文章摘要超时。当你出现这个问题时，可能是key或者绑定的域名不正确。也可能是因为文章过长导致的 AI 运算量过大，您可以稍等一下然后刷新页面重试。';\n            }\n        } else {\n            console.error('请求失败：', error);\n            return '获取文章摘要失败，请稍后再试。';\n        }\n    }\n  }\n}\n\nfunction runTianliGPT() {\n  insertAIDiv(tianliGPT_postSelector);\n  const content = tianliGPT.getTitleAndContent();\n  if (!content && content !== '') {\n    console.log('TianliGPT本次提交的内容为：' + content);\n  }\n  tianliGPT.fetchTianliGPT(content).then(summary => {\n    const aiExplanationDiv = document.querySelector('.tianliGPT-explanation');\n    aiExplanationDiv.innerHTML = summary;\n  })\n}\n\nfunction checkURLAndRun() {\n  if (typeof tianliGPT_postURL === \"undefined\") {\n    runTianliGPT(); // 如果没有设置自定义 URL，则直接执行 runTianliGPT() 函数\n    return;\n  }\n\n  try {\n    const wildcardToRegExp = (s) => {\n      return new RegExp('^' + s.split(/\\*+/).map(regExpEscape).join('.*') + '$');\n    };\n\n    const regExpEscape = (s) => {\n      return s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n    };\n\n    const urlPattern = wildcardToRegExp(tianliGPT_postURL);\n    const currentURL = window.location.href;\n\n    if (urlPattern.test(currentURL)) {\n      runTianliGPT(); // 如果当前 URL 符合用户设置的 URL，则执行 runTianliGPT() 函数\n    } else {\n      console.log(\"TianliGPT：因为不符合自定义的链接规则，我决定不执行摘要功能。\");\n    }\n  } catch (error) {\n    console.error(\"TianliGPT：我没有看懂你编写的自定义链接规则，所以我决定不执行摘要功能\", error);\n  }\n}\n\ncheckURLAndRun();"
  },
  {
    "path": "folder-alias.json",
    "content": "{}"
  },
  {
    "path": "package.json",
    "content": "{\n  \"devDependencies\": {\n    \"vitepress\": \"^1.0.0-rc.10\"\n  },\n  \"scripts\": {\n    \"docs:dev\": \"vitepress dev docs\",\n    \"docs:build\": \"vitepress build docs\",\n    \"docs:preview\": \"vitepress preview docs\"\n  }\n}"
  },
  {
    "path": "tianli_gpt.css",
    "content": ":root {\n  --heo-white: #fff;\n  --heo-white-op: rgba(255, 255, 255, 0.2);\n  --heo-black: #000;\n  --heo-black-op: rgba(0, 0, 0, 0.2);\n  --heo-none: #00000000;\n  --heo-gray: #999999;\n  --heo-gray-op: #9999992b;\n  --heo-vip: #e5a80d;\n  --heo-main: var(--heo-theme);\n  --heo-main-op: var(--heo-theme-op);\n  --heo-main-op-deep: var(--heo-theme-op-deep);\n  --heo-main-none: var(--heo-theme-none);\n  --heo-shadow-theme: 0 8px 12px -3px var(--heo-theme-op);\n  --heo-shadow-blackdeep: 0 2px 16px -3px rgba(0, 0, 0, .15);\n  --heo-shadow-main: 0 8px 12px -3px var(--heo-main-op);\n  --heo-shadow-blue: 0 8px 12px -3px rgba(40, 109, 234, .20);\n  --heo-shadow-white: 0 8px 12px -3px rgba(255, 255, 255, .20);\n  --heo-shadow-black: 0 0 12px 4px rgba(0, 0, 0, .05);\n  --heo-shadow-yellow: 0px 38px 77px -26px rgba(255, 201, 62, .12);\n  --heo-shadow-red: 0 8px 12px -3px #ee7d7936;\n  --heo-shadow-green: 0 8px 12px -3px #87ee7936;\n  --heo-logo-color: linear-gradient(215deg, #4584ff 0%, #cf0db9 100%);\n  --heo-snackbar-time: 5s;\n  --heo-theme: #425AEF;\n  --heo-theme-op: #4259ef23;\n  --heo-theme-op-deep: #4259efdd;\n  --heo-theme-none: #4259ef01;\n  --heo-blue: #425AEF;\n  --heo-red: #f04a63;\n  --heo-pink: #FF7C7C;\n  --heo-green: #57bd6a;\n  --heo-yellow: #c28b00;\n  --heo-yellow-op: #d99c001a;\n  --heo-orange: #e38100;\n  --heo-fontcolor: #363636;\n  --heo-background: #f7f9fe;\n  --heo-reverse: #000;\n  --heo-maskbg: rgba(255, 255, 255, 0.6);\n  --heo-maskbgdeep: rgba(255, 255, 255, 0.85);\n  --heo-hovertext: var(--heo-main);\n  --heo-ahoverbg: #F7F7FA;\n  --heo-lighttext: var(--heo-main);\n  --heo-secondtext: rgba(60, 60, 67, 0.8);\n  --heo-scrollbar: rgba(60, 60, 67, 0.4);\n  --heo-card-btn-bg: #edf0f7;\n  --heo-post-blockquote-bg: #fafcff;\n  --heo-post-tabs-bg: #f2f5f8;\n  --heo-secondbg: #f1f3f8;\n  --heo-shadow-nav: 0 5px 12px -5px rgba(102, 68, 68, 0.05);\n  --heo-card-bg: #fff;\n  --heo-card-bg-op: var(--heo-black-op);\n  --heo-card-bg-none: rgba(255, 255, 255, 0);\n  --heo-shadow-lightblack: 0 5px 12px -5px rgba(102, 68, 68, 0.00);\n  --heo-shadow-light2black: 0 5px 12px -5px rgba(102, 68, 68, 0.00);\n  --heo-card-border: #e3e8f7;\n  --heo-shadow-border: 0 8px 16px -4px #2c2d300c;\n  --style-border: 1px solid var(--heo-card-border);\n  --style-border-always: 1px solid var(--heo-card-border);\n  --style-border-hover: 1px solid var(--heo-main);\n  --style-border-hover-always: 1px solid var(--heo-main);\n  --style-border-dashed: 1px dashed var(--heo-theme-op);\n  --style-border-forever: 2px solid var(--heo-main);\n}\n\n[data-theme=light] {\n  --heo-theme: #425AEF;\n  --heo-theme-op: #4259ef23;\n  --heo-theme-op-deep: #4259efdd;\n  --heo-theme-none: #4259ef01;\n  --heo-blue: #425AEF;\n  --heo-red: #f04a63;\n  --heo-pink: #FF7C7C;\n  --heo-green: #57bd6a;\n  --heo-yellow: #c28b00;\n  --heo-yellow-op: #d99c001a;\n  --heo-orange: #e38100;\n  --heo-fontcolor: #363636;\n  --heo-background: #f7f9fe;\n  --heo-reverse: #000;\n  --heo-maskbg: rgba(255, 255, 255, 0.6);\n  --heo-maskbgdeep: rgba(255, 255, 255, 0.85);\n  --heo-hovertext: var(--heo-main);\n  --heo-ahoverbg: #F7F7FA;\n  --heo-lighttext: var(--heo-main);\n  --heo-secondtext: rgba(60, 60, 67, 0.8);\n  --heo-scrollbar: rgba(60, 60, 67, 0.4);\n  --heo-card-btn-bg: #edf0f7;\n  --heo-post-blockquote-bg: #fafcff;\n  --heo-post-tabs-bg: #f2f5f8;\n  --heo-secondbg: #f1f3f8;\n  --heo-shadow-nav: 0 5px 12px -5px rgba(102, 68, 68, 0.05);\n  --heo-card-bg: #fff;\n  --heo-card-bg-op: var(--heo-black-op);\n  --heo-card-bg-none: rgba(255, 255, 255, 0);\n  --heo-shadow-lightblack: 0 5px 12px -5px rgba(102, 68, 68, 0.00);\n  --heo-shadow-light2black: 0 5px 12px -5px rgba(102, 68, 68, 0.00);\n  --heo-card-border: #e3e8f7;\n  --heo-shadow-border: 0 8px 16px -4px #2c2d300c;\n  --style-border: 1px solid var(--heo-card-border);\n  --style-border-always: 1px solid var(--heo-card-border);\n  --style-border-hover: 1px solid var(--heo-main);\n  --style-border-hover-always: 1px solid var(--heo-main);\n  --style-border-dashed: 1px dashed var(--heo-theme-op);\n  --style-border-forever: 2px solid var(--heo-main);\n}\n\n[data-theme=dark], body.dark, body.dark-theme,[eagle-extension-theme=\"dark\"],body.dark-open,[color-scheme=dark],[data-scheme=\"inverse\"] {\n  --heo-theme: #f2b94b;\n  --heo-theme-op: #f2b94b23;\n  --heo-theme-op-deep: #f2b94bdd;\n  --heo-theme-none: #f2b94b00;\n  --heo-blue: #0084FF;\n  --heo-red: #FF3842;\n  --heo-pink: #d44040;\n  --heo-green: #3e9f50;\n  --heo-yellow: #ffc93e;\n  --heo-yellow-op: #ffc93e30;\n  --heo-orange: #ff953e;\n  --heo-fontcolor: #F7F7FA;\n  --heo-background: #18171d;\n  --heo-reverse: #fff;\n  --heo-maskbg: rgba(0, 0, 0, 0.6);\n  --heo-maskbgdeep: rgba(0, 0, 0, 0.85);\n  --heo-hovertext: #0A84FF;\n  --heo-ahoverbg: #fff;\n  --heo-lighttext: var(--heo-theme);\n  --heo-secondtext: #a1a2b8;\n  --heo-scrollbar: rgba(200, 200, 223, 0.4);\n  --heo-card-btn-bg: #30343f;\n  --heo-post-blockquote-bg: #000;\n  --heo-post-tabs-bg: #121212;\n  --heo-secondbg: #30343f;\n  --heo-shadow-nav: 0 5px 20px 0px rgba(28, 28, 28, 0.4);\n  --heo-card-bg: #1d1e22;\n  --heo-card-bg-op: var(--heo-white-op);\n  --heo-card-bg-none: #1d1b2600;\n  --heo-shadow-lightblack: 0 5px 12px -5px rgba(102, 68, 68, 0.0);\n  --heo-shadow-light2black: 0 5px 12px -5px rgba(102, 68, 68, 0.0);\n  --heo-card-border: #3d3d3f;\n  --heo-shadow-border: 0 8px 16px -4px #00000050;\n  --style-border: 1px solid var(--heo-card-border);\n  --style-border-always: 1px solid var(--heo-card-border);\n  --style-border-hover: 1px solid var(--heo-theme);\n  --style-border-hover-always: 1px solid var(--heo-theme);\n  --style-border-dashed: 1px dashed var(--heo-theme-op);\n  --style-border-forever: 2px solid var(--heo-lighttext);\n}\n\n/* AI */\n.post-TianliGPT {\n  background: var(--heo-secondbg);\n  border-radius: 12px;\n  padding: 12px;\n  line-height: 1.3;\n  border: var(--style-border-always);\n  margin: 16px 0;\n}\n\n@media screen and (max-width: 768px) {\n  .post-TianliGPT {\n    margin-top: 22px;\n  }\n}\n\n.tianliGPT-title {\n  display: flex;\n  color: var(--heo-lighttext);\n  border-radius: 8px;\n  align-items: center;\n  padding: 0 12px;\n  cursor: default;\n  user-select: none;\n  position: relative;\n}\n\n.tianliGPT-title-text {\n  font-weight: bold;\n  margin-left: 8px;\n  line-height: 1;\n}\n\n.tianliGPT-explanation {\n  margin-top: 12px;\n  padding: 8px 12px;\n  background: var(--heo-card-bg);\n  border-radius: 8px;\n  border: var(--style-border-always);\n  font-size: 15px;\n  line-height: 1.4;\n  display: block;\n  color: var(--heo-fontcolor);\n}\n\n.tianliGPT-suggestions {\n  display: flex;\n  flex-wrap: wrap;\n}\n\n.tianliGPT-suggestions .tianliGPT-suggestions-item {\n  margin-top: 12px;\n  padding: 8px 12px;\n  background: var(--heo-card-bg);\n  border-radius: 8px 8px 8px 0;\n  border: var(--style-border-always);\n  font-size: 15px;\n  line-height: 1.4;\n  display: flex;\n  width: fit-content;\n  margin-right: 12px;\n  cursor: pointer;\n  transition: 0.3s;\n}\n\n.tianliGPT-suggestions .tianliGPT-suggestions-item:hover {\n  background: var(--heo-main);\n  color: var(--heo-white);\n}\n\n.blinking-cursor {\n  background-color: var(--heo-lighttext);\n  width: 14px;\n  height: 14px;\n  border-radius: 16px;\n  display: inline-block;\n  vertical-align: middle;\n  animation: blinking-cursor 2s infinite;\n  -webkit-animation: blinking-cursor 2s infinite;\n  margin-left: 4px;\n  margin-bottom: 3px;\n  transform: scale(0.6);\n}\n\n@keyframes blinking-cursor {\n  0% {\n    transform: scale(0.6);\n  }\n\n  25% {\n    transform: scale(1);\n  }\n\n  50% {\n    transform: scale(0.6);\n  }\n\n  75% {\n    transform: scale(1);\n  }\n\n  100% {\n    transform: scale(0.6);\n  }\n}\n\n.tianliGPT-tag {\n  font-size: 12px;\n  background-color: var(--heo-lighttext);\n  box-shadow: var(--heo-shadow-main);\n  color: var(--heo-card-bg);\n  font-weight: 700;\n  border-radius: 12px;\n  margin-left: auto;\n  line-height: 12px;\n  padding: 6px 8px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  transition: .3s;\n}\n\n.tianliGPT-tag.loadingAI {\n  animation-duration: 2s;\n  animation-name: AILoading;\n  animation-iteration-count: infinite;\n  animation-direction: alternate;\n  cursor: default;\n}\n\n@keyframes AILoading {\n  0% {\n    opacity: 1;\n  }\n  25% {\n    opacity: 0.3;\n  }\n  50% {\n    opacity: 1;\n  }\n  75% {\n    opacity: 0.3;\n  }\n  100% {\n    opacity: 1;\n  }\n}\n\nins.adsbygoogle {\n  margin: 16px 0;\n  background: var(--heo-card-bg);\n  border-radius: 12px;\n  overflow: hidden;\n  border: var(--style-border-always);\n}\n\n#tianliGPT-Toggle {\n  font-size: 12px;\n  background: var(--heo-lighttext);\n  color: var(--heo-card-bg);\n  padding: 4px;\n  border-radius: 4px;\n  margin-left: 6px;\n  transform: scale(0.8);\n  cursor: pointer;\n  transition: 0.3s;\n  font-weight: bold;\n}\n\n#tianliGPT-Toggle:hover {\n  background: var(--heo-fontcolor);\n  color: var(--heo-card-bg);\n}\n\n.tianliGPT-title-icon {\n  width: 24px;\n  height: 24px;\n  display: flex;\n  background: var(--heo-lighttext);\n  color: var(--heo-card-bg);\n  font-size: 14px;\n  border-radius: 20px;\n  justify-content: center;\n  align-items: center;\n}\n\n.tianliGPT-title-icon svg {\n  width: 14px;\n  height: 14px;\n  fill: var(--heo-card-bg);\n}\n\n.tianliGPT-title-icon svg path {\n  fill: var(--heo-card-bg);\n}\n"
  },
  {
    "path": "tianli_gpt.js",
    "content": "console.log(\"\\n %c Post-Abstract-AI 博客文章摘要AI生成工具 %c https://github.com/zhheo/Post-Abstract-AI \\n\", \"color: #fadfa3; background: #030307; padding:5px 0;\", \"background: #fadfa3; padding:5px 0;\")\n\nvar tianliGPTIsRunning = false;\nfunction tianliGPT(usePjax) {\n\n  function insertAIDiv(selector) {\n    // 首先移除现有的 \"post-TianliGPT\" 类元素（如果有的话）\n    removeExistingAIDiv();\n\n    // 获取目标元素\n    let targetElement = document.querySelector(selector);\n\n    // 如果没有找到目标元素，持续尝试直到超时\n    if (!targetElement) {\n      const maxDuration = 20000; // 最大等待时间10秒\n      const interval = 300; // 每0.3秒检查一次\n      let elapsed = 0; // 已经过去的时间\n\n      const intervalId = setInterval(() => {\n          elapsed += interval;\n          targetElement = document.querySelector(selector); // 使用let声明后，这里可以更新外部的targetElement变量\n\n          if (targetElement) {\n              clearInterval(intervalId); // 找到元素，清除定时器\n              // console.log('找到目标元素:', targetElement);\n              // 这里可以添加对找到的元素的操作\n          } else if (elapsed >= maxDuration) {\n              clearInterval(intervalId); // 超时，清除定时器\n              console.log('超时未找到元素');\n              return\n          }\n      }, interval);\n    }\n\n    // 创建要插入的HTML元素\n    const aiDiv = document.createElement('div');\n    aiDiv.className = 'post-TianliGPT';\n\n    const aiTitleDiv = document.createElement('div');\n    aiTitleDiv.className = 'tianliGPT-title';\n    aiDiv.appendChild(aiTitleDiv);\n\n    const aiIcon = document.createElement('i');\n    aiIcon.className = 'tianliGPT-title-icon';\n    aiTitleDiv.appendChild(aiIcon);\n\n    // 插入 SVG 图标\n    aiIcon.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\">\n    <g id=\"&#x673A;&#x5668;&#x4EBA;\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n      <path d=\"M34.717885,5.03561087 C36.12744,5.27055371 37.079755,6.60373651 36.84481,8.0132786 L35.7944,14.3153359 L38.375,14.3153359 C43.138415,14.3153359 47,18.1768855 47,22.9402569 L47,34.4401516 C47,39.203523 43.138415,43.0650727 38.375,43.0650727 L9.625,43.0650727 C4.861585,43.0650727 1,39.203523 1,34.4401516 L1,22.9402569 C1,18.1768855 4.861585,14.3153359 9.625,14.3153359 L12.2056,14.3153359 L11.15519,8.0132786 C10.920245,6.60373651 11.87256,5.27055371 13.282115,5.03561087 C14.69167,4.80066802 16.024865,5.7529743 16.25981,7.16251639 L17.40981,14.0624532 C17.423955,14.1470924 17.43373,14.2315017 17.43948,14.3153359 L30.56052,14.3153359 C30.56627,14.2313867 30.576045,14.1470924 30.59019,14.0624532 L31.74019,7.16251639 C31.975135,5.7529743 33.30833,4.80066802 34.717885,5.03561087 Z M38.375,19.4902885 L9.625,19.4902885 C7.719565,19.4902885 6.175,21.0348394 6.175,22.9402569 L6.175,34.4401516 C6.175,36.3455692 7.719565,37.89012 9.625,37.89012 L38.375,37.89012 C40.280435,37.89012 41.825,36.3455692 41.825,34.4401516 L41.825,22.9402569 C41.825,21.0348394 40.280435,19.4902885 38.375,19.4902885 Z M14.8575,23.802749 C16.28649,23.802749 17.445,24.9612484 17.445,26.3902253 L17.445,28.6902043 C17.445,30.1191812 16.28649,31.2776806 14.8575,31.2776806 C13.42851,31.2776806 12.27,30.1191812 12.27,28.6902043 L12.27,26.3902253 C12.27,24.9612484 13.42851,23.802749 14.8575,23.802749 Z M33.1425,23.802749 C34.57149,23.802749 35.73,24.9612484 35.73,26.3902253 L35.73,28.6902043 C35.73,30.1191812 34.57149,31.2776806 33.1425,31.2776806 C31.71351,31.2776806 30.555,30.1191812 30.555,28.6902043 L30.555,26.3902253 C30.555,24.9612484 31.71351,23.802749 33.1425,23.802749 Z\" id=\"&#x5F62;&#x72B6;&#x7ED3;&#x5408;\" fill=\"#444444\" fill-rule=\"nonzero\"></path>\n    </g>\n    </svg>`;\n\n    const aiTitleTextDiv = document.createElement('div');\n    aiTitleTextDiv.className = 'tianliGPT-title-text';\n    if (typeof tianliGPT_Title === \"undefined\") {\n      aiTitleTextDiv.textContent = 'AI摘要';\n    }else {\n      aiTitleTextDiv.textContent = tianliGPT_Title;\n    }\n    aiTitleDiv.appendChild(aiTitleTextDiv);\n\n    const aiTagDiv = document.createElement('div');\n    aiTagDiv.className = 'tianliGPT-tag';\n    aiTagDiv.id = 'tianliGPT-tag';\n    if (typeof tianliGPT_Name === \"undefined\") {\n      aiTagDiv.textContent = 'TianliGPT';\n    }else {\n      aiTagDiv.textContent = tianliGPT_Name;\n    }\n    aiTitleDiv.appendChild(aiTagDiv);\n\n    const aiExplanationDiv = document.createElement('div');\n    aiExplanationDiv.className = 'tianliGPT-explanation';\n    aiExplanationDiv.innerHTML = '生成中...' + '<span class=\"blinking-cursor\"></span>';\n    aiDiv.appendChild(aiExplanationDiv); // 将 tianliGPT-explanation 插入到 aiDiv，而不是 aiTitleDiv\n\n    // 将创建的元素插入到目标元素的顶部\n    targetElement.insertBefore(aiDiv, targetElement.firstChild);\n  }\n\n  function removeExistingAIDiv() {\n    // 查找具有 \"post-TianliGPT\" 类的元素\n    const existingAIDiv = document.querySelector(\".post-TianliGPT\");\n\n    // 如果找到了这个元素，就从其父元素中删除它\n    if (existingAIDiv) {\n      existingAIDiv.parentElement.removeChild(existingAIDiv);\n    }\n  }\n\n  var tianliGPT = {\n    //读取文章中的所有文本\n    getTitleAndContent: function() {\n      try {\n        const title = document.title;\n        const container = document.querySelector(tianliGPT_postSelector);\n        if (!container) {\n          console.warn('TianliGPT：找不到文章容器。请尝试将引入的代码放入到文章容器之后。如果本身没有打算使用摘要功能可以忽略此提示。');\n          return '';\n        }\n        const paragraphs = container.getElementsByTagName('p');\n        const headings = container.querySelectorAll('h1, h2, h3, h4, h5');\n        let content = '';\n\n        for (let h of headings) {\n          content += h.innerText + ' ';\n        }\n\n        for (let p of paragraphs) {\n          // 移除包含'http'的链接\n          const filteredText = p.innerText.replace(/https?:\\/\\/[^\\s]+/g, '');\n          content += filteredText;\n        }\n\n        const combinedText = title + ' ' + content;\n        let wordLimit = 1000;\n        if (typeof tianliGPT_wordLimit !== \"undefined\") {\n          wordLimit = tianliGPT_wordLimit;\n        }\n        const truncatedText = combinedText.slice(0, wordLimit);\n        return truncatedText;\n      } catch (e) {\n        console.error('TianliGPT错误：可能由于一个或多个错误导致没有正常运行，原因出在获取文章容器中的内容失败，或者可能是在文章转换过程中失败。', e);\n        return '';\n      }\n    },\n\n    fetchTianliGPT: async function(content) {\n      if (!tianliGPT_key) {\n        let info = \"没有获取到key，代码可能没有安装正确。如果你需要在tianli_gpt文件引用前定义tianliGPT_key变量。详细请查看文档。\"\n        tianliGPT.aiShowAnimation(info)\n        return info;\n      }\n\n      if (tianliGPT_key === \"5Q5mpqRK5DkwT1X9Gi5e\") {\n        let info = \"请购买 key 使用，如果你能看到此条内容，则说明代码安装正确。\"\n        tianliGPT.aiShowAnimation(info)\n        return info;\n      }\n      var url = window.location.href;\n      const title = document.title;\n      const apiUrl = 'https://summary.tianli0.top/';\n      const timeout = 20000; // 设置超时时间（毫秒）\n\n      try {\n        const controller = new AbortController();\n        const timeoutId = setTimeout(() => controller.abort(), timeout);\n        const response = await fetch(apiUrl, {\n          method: 'POST',\n          headers: {\n            'Content-Type': 'application/json'\n          },\n          body: JSON.stringify({\n            content: content,\n            key: tianliGPT_key,\n            url: window.location.href,\n            title: document.title\n          }),\n          signal: controller.signal\n        });\n        clearTimeout(timeoutId); // 清除定时器，避免不必要的abort\n\n        if (response.ok) {\n          const data = await response.json();\n          return {\n            summary: data.summary\n          };\n        } else {\n          let info = \"\"\n          const errorData = await response.json(); // 假设错误响应也是JSON格式\n\n          if (response.status === 514) {\n            info = \"TianliGPT is only available in mainland China, and is not yet open to overseas users, so stay tuned!\";\n            tianliGPT.aiShowAnimation(info);\n            return info;\n          }\n\n          // 根据403错误处理\n          if (response.status === 403) {\n            switch (errorData.err_code) {\n              case 1:\n                // 你的具体错误处理逻辑，例如显示某个特定的错误信息\n                info = \"你的网站设置了Referrer-Policy为same-origin，这会导致Tianli无法验证你的请求来源。TianliGPT依赖refer进行来源判断，特别是meta标签的referrer属性需要修改，至少为origin。例如：<meta name=\\\"referrer\\\" content=\\\"origin\\\">\";\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              case 2:\n                // 你的具体错误处理逻辑，例如显示某个特定的错误信息\n                info = \"你正在使用的tianliGPT_key没有绑定当前网站，请检查当前的密钥是否绑定了当前网站地址。可以到summary.zhheo.com中绑定。\";\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              // 这里可以添加更多的err_code判断分支\n              case 3:\n                info = \"参数缺失，请检查是否正确配置tianliGPT_key\"\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              case 4:\n                document.querySelectorAll('.post-TianliGPT').forEach(el => {\n                  el.style.display = 'none';\n                });\n                info = \"Key错误或余额不足，请充值后请求新的文章\"\n                throw new Error('TianliGPT：'+info);\n              case 5:\n                info = errorData.err_msg\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              case 6:\n                info = errorData.err_msg\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              case 7:\n                info = errorData.err_msg\n                tianliGPT.aiShowAnimation(info);\n                return info;\n              default:\n                // 默认的处理逻辑\n                tianliGPT.aiShowAnimation(\"未知错误，请检查API文档\");\n                return \"未知错误，请检查API文档\";\n            }\n          }\n        }\n      } catch (error) {\n        if (error.name === 'AbortError') {\n          if (window.location.hostname === 'localhost') {\n            console.warn('警告：请勿在本地主机上测试 API 密钥。');\n            return '获取文章摘要超时。请勿在本地主机上测试 API 密钥。';\n          } else {\n            console.error('请求超时');\n            return '获取文章摘要超时。当你出现这个问题时，可能是key或者绑定的域名不正确。也可能是因为文章过长导致的 AI 运算量过大，您可以稍等一下然后刷新页面重试。';\n          }\n        } else {\n          console.error('请求失败：', error);\n          return '获取文章摘要失败，请稍后再试。';\n        }\n      }\n    },\n\n    aiShowAnimation: function (text) {\n      const element = document.querySelector(\".tianliGPT-explanation\");\n      if (!element) {\n        return;\n      }\n\n      if (tianliGPTIsRunning) {\n        return;\n      }\n\n      // 检查用户是否已定义tianliGPT_typingAnimate并且其值为false\n      if (typeof tianliGPT_typingAnimate !== \"undefined\" && !tianliGPT_typingAnimate) {\n        // 如果用户已定义tianliGPT_typingAnimate并且其值为false，则立即显示完整文本\n        element.innerHTML = text;\n        return;\n      }\n\n      tianliGPTIsRunning = true;\n      const typingDelay = 25;\n      const waitingTime = 1000;\n      const punctuationDelayMultiplier = 6;\n\n      element.style.display = \"block\";\n      element.innerHTML = \"生成中...\" + '<span class=\"blinking-cursor\"></span>';\n\n      //给AItag添加动画\n      const aiTag = document.querySelector('.tianliGPT-tag');\n      aiTag.classList.add('loadingAI');\n\n      let animationRunning = true;\n      let currentIndex = 0;\n      let initialAnimation = true;\n      let lastUpdateTime = performance.now();\n\n      const animate = () => {\n        if (currentIndex < text.length && animationRunning) {\n          const currentTime = performance.now();\n          const timeDiff = currentTime - lastUpdateTime;\n\n          const letter = text.slice(currentIndex, currentIndex + 1);\n          const isPunctuation = /[，。！、？,.!?]/.test(letter);\n          const delay = isPunctuation ? typingDelay * punctuationDelayMultiplier : typingDelay;\n\n          if (timeDiff >= delay) {\n            element.innerText = text.slice(0, currentIndex + 1);\n            lastUpdateTime = currentTime;\n            currentIndex++;\n\n            if (currentIndex < text.length) {\n              element.innerHTML =\n                text.slice(0, currentIndex) +\n                '<span class=\"blinking-cursor\"></span>';\n            } else {\n              element.innerHTML = text;\n              element.style.display = \"block\";\n              tianliGPTIsRunning = false;\n              observer.disconnect(); // 暂停监听\n              //给AItag停止动画\n              const aiTag = document.querySelector('.tianliGPT-tag');\n              aiTag.classList.remove('loadingAI');\n            }\n          }\n          requestAnimationFrame(animate);\n        }\n      }\n\n      // 使用IntersectionObserver对象优化ai离开视口后暂停的业务逻辑，提高性能\n      const observer = new IntersectionObserver((entries) => {\n        let isVisible = entries[0].isIntersecting;\n        animationRunning = isVisible; // 标志变量更新\n        if (animationRunning && initialAnimation) {\n          setTimeout(() => {\n            requestAnimationFrame(animate);\n          }, 200);\n        }\n      }, { threshold: 0 });\n      let post_ai = document.querySelector('.post-TianliGPT');\n      observer.observe(post_ai); //启动新监听\n    },\n  }\n  function runTianliGPT() {\n    if (typeof tianliGPT_postSelector === 'undefined') {\n      return;\n    }\n    \n    insertAIDiv(tianliGPT_postSelector);\n    const content = tianliGPT.getTitleAndContent();\n    if (content) {\n      console.log('TianliGPT本次提交的内容为：' + content);\n    }\n    tianliGPT.fetchTianliGPT(content).then(data => {\n      const summary = data.summary;\n      tianliGPT.aiShowAnimation(summary);\n    })\n  }\n\n  function checkURLAndRun() {\n    if (typeof tianliGPT_postURL === \"undefined\") {\n      tianliGPTCustomBlackList(); // 如果没有设置自定义 URL，则直接执行 runTianliGPT() 函数\n      return;\n    }\n  \n    try {\n      const wildcardToRegExp = (s) => {\n        return new RegExp('^' + s.split(/\\*+/).map(regExpEscape).join('.*') + '$');\n      };\n  \n      const regExpEscape = (s) => {\n        return s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n      };\n  \n      const urlPattern = wildcardToRegExp(tianliGPT_postURL);\n      const currentURL = window.location.href;\n  \n      if (urlPattern.test(currentURL)) {\n        attemptRunTianliGPT(); // 使用新函数处理重试逻辑\n      } else {\n        console.log(`TianliGPT：当前 URL '${currentURL}' 不符合规则 '${tianliGPT_postURL}'，所以我决定不执行摘要功能。`);\n      }\n    } catch (error) {\n      console.error(\"TianliGPT：我没有看懂你编写的自定义链接规则，所以我决定不执行摘要功能\", error);\n    }\n  }\n\n  function attemptRunTianliGPT() {\n    const maxAttempts = 20; // 最多尝试10秒\n    let attempts = 0;\n  \n    const interval = setInterval(() => {\n      try {\n        tianliGPTCustomBlackList(); // 尝试执行 runTianliGPT\n        clearInterval(interval); // 如果成功，清除定时器\n        // console.log(\"TianliGPT：成功执行！\");\n      } catch (error) {\n        if (attempts >= maxAttempts) {\n          clearInterval(interval); // 超过尝试次数，清除定时器\n          console.error(\"TianliGPT：超时失败，停止尝试。\", error);\n        }\n        attempts++;\n      }\n    }, 200); // 每1秒尝试一次\n  }\n\n  function tianliGPTCustomBlackList() {\n    if (typeof tianliGPT_blacklist === \"undefined\" || !tianliGPT_blacklist) {\n        runTianliGPT(); // 如果没有设置自定义 URL 或 URL 为空，则直接执行 runTianliGPT() 函数\n        return;\n    } else {\n        // 使用 fetch 请求 JSON 文件\n        fetch(tianliGPT_blacklist)\n            .then(response => response.json())\n            .then(data => {\n                const urlList = data.blackurls;  // 假设 JSON 文件中有一个 blackurls 键\n                let currentPageUrl = window.location.href;\n                let isBlacklisted = urlList.some(pattern => {\n                    // 将通配符转换为正则表达式\n                    let regex = new RegExp(\"^\" + pattern.replace(/\\*/g, \".*\") + \"$\");\n                    return regex.test(currentPageUrl);\n                });\n\n                // 如果当前页面 URL 不在黑名单中，则执行 tianliGPT\n                if (!isBlacklisted) {\n                    runTianliGPT();\n                }\n            })\n            .catch(error => {\n                console.error('请求黑名单失败。Error fetching blacklist:', error);\n                runTianliGPT(); // 请求出错时继续执行 runTianliGPT()\n            });\n    }\n}\n\n  if (usePjax) {\n    checkURLAndRun();\n  } else {\n    document.addEventListener(\"DOMContentLoaded\", function () {\n      checkURLAndRun();\n    });\n  }\n}\n\ntianliGPT(false);\n\ndocument.addEventListener('pjax:complete', function () {\n  tianliGPT(true);\n})\n\n(function(history){\n  var pushState = history.pushState;\n  history.pushState = function(state) {\n      if (typeof history.onpushstate == \"function\") {\n        setTimeout(function () {\n          history.onpushstate({ state: state });\n        }, 100);\n      }\n      // 调用原函数并返回结果\n      return pushState.apply(history, arguments);\n  };\n})(window.history);\n\n// 现在你可以定义一个onpushstate函数来处理pushState调用\nwindow.history.onpushstate = function(event) {\n  // 调用你的统计函数\n  tianliGPT(true);\n};"
  }
]