Libby 图书监控器:追踪图书馆藏书可用性 - Openclaw Skills

作者:互联网

2026-03-31

AI教程

什么是 Libby 图书监控器?

Libby 图书监控器是一款强大的自动化工具,旨在优化用户与数字图书馆目录的交互方式。作为 Openclaw Skills 生态系统中的一个通用组件,它可以无缝搜索和监控 Libby 或 OverDrive 馆藏。它有效地弥补了手动搜索与自动通知之间的差距,提供了一种程序化方式来随时了解图书馆的采编动态。

该工具专注于简单性和效率,除了 Python 标准库外无需任何外部依赖。对于管理多张借书卡并希望集中追踪高需求书目的研究人员和书迷来说,这是一个必不可少的实用程序。通过利用 Openclaw Skills,用户可以将这些图书馆检查集成到更广泛的自动化流程中。

下载入口:https://github.com/openclaw/skills/tree/main/skills/alexpolonsky/libby-book-monitor

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install libby-book-monitor

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 libby-book-monitor。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Libby 图书监控器 应用场景

  • 监控多个图书馆目录以获取特定书籍的发布情况。
  • 针对高需求书目自动执行每日可用性检查。
  • 为不同的家庭成员或个人资料管理独立的阅读监视列表。
  • 识别当地图书馆何时购入特定作者的新作品。
Libby 图书监控器 工作原理
  1. 用户在配置中指定图书馆子域名(例如,纽约公共图书馆为 nypl)。
  2. 将书籍添加到本地监视列表,并可选择包含作者和图书馆元数据。
  3. 脚本针对图书馆的后端服务执行 API 查询。
  4. 工具分析 isOwned 状态以确定该书目是否属于数字馆藏。
  5. 在自动化运行期间,状态更新会报告给用户或传递给通知系统。

Libby 图书监控器 配置指南

确保您的系统中安装了 Python 3。此技能已针对 Openclaw Skills 框架内的使用进行了优化。

# 搜索书籍以查找正确的元数据
python3 scripts/libby-book-monitor.py search nypl "Dune"

# 将书籍添加到您的监视列表
python3 scripts/libby-book-monitor.py watch "The Great Gatsby"

# 运行检查以查看当前状态
python3 scripts/libby-book-monitor.py check

Libby 图书监控器 数据架构与分类体系

该技能管理 ~/.libby-book-monitor/ 目录下的数据。结构组织如下:

组件 描述
config.json 存储图书馆定义和默认图书馆代码。
监视列表数据 包含书籍、作者列表及其最后已知的可用性状态。
配置文件 (Profiles) 通过 --profile 标志为每个用户维护的独立监视列表。
数据目录 通过 --data-dir 或环境变量配置的存储路径。
name: libby-book-monitor
version: 1.0.0
description: Track book availability on Libby/OverDrive libraries. Search library catalogues, manage a watchlist, and get notified when books are added. Use for "libby", "check libby", "libby watchlist", "is book on libby", "book available", "overdrive", "library catalogue", "??????", "?????".
author: Alex Polonsky (https://github.com/alexpolonsky)
homepage: https://github.com/alexpolonsky/agent-skill-libby-book-monitor
metadata: {"openclaw": {"emoji": "??", "os": ["darwin", "linux"], "requires": {"bins": ["python3"]}}}

Libby/OverDrive Book Monitor

Track book availability on Libby/OverDrive libraries. Search catalogues, manage a watchlist, and get notified when books are added to your library's collection.

Disclaimer: This is an unofficial tool, not affiliated with or endorsed by OverDrive/Libby. Catalogue data queries APIs that power the website and may not reflect actual availability. This tool does NOT borrow books or place holds. Provided "as is" without warranty of any kind.

Quick Start

# Search a library catalogue
python3 {baseDir}/scripts/libby-book-monitor.py search telaviv "Project Hail Mary"

# Add a book to your watchlist
python3 {baseDir}/scripts/libby-book-monitor.py watch "Kafka on the Shore" --author "Haruki Murakami"

# Check your watchlist against the API
python3 {baseDir}/scripts/libby-book-monitor.py check

# Show your watchlist
python3 {baseDir}/scripts/libby-book-monitor.py list

Commands

Command Description
search Search a library catalogue by title/author
watch </CODE></TD> <TD>Add a book to the watchlist</TD></TR> <TR> <TD><CODE>unwatch <title></CODE></TD> <TD>Remove a book from the watchlist</TD></TR> <TR> <TD><CODE>list</CODE></TD> <TD>Show the watchlist with status</TD></TR> <TR> <TD><CODE>check</CODE></TD> <TD>Check all watchlist books against the API</TD></TR></TBODY></TABLE></DIV> <H2 id=options>Options</H2> <DIV class=table-scroll-wrapper> <TABLE> <THEAD> <TR> <TH>Option</TH> <TH>Commands</TH> <TH>Description</TH></TR></THEAD> <TBODY> <TR> <TD><CODE>--profile <name></CODE></TD> <TD>all</TD> <TD>Separate watchlist per user</TD></TR> <TR> <TD><CODE>--author <name></CODE></TD> <TD>watch</TD> <TD>Specify book author</TD></TR> <TR> <TD><CODE>--library <code></CODE></TD> <TD>watch</TD> <TD>Library code (default: from config)</TD></TR> <TR> <TD><CODE>--notify</CODE></TD> <TD>check</TD> <TD>Only print newly found books (for cron)</TD></TR> <TR> <TD><CODE>--data-dir <path></CODE></TD> <TD>all</TD> <TD>Custom data directory</TD></TR></TBODY></TABLE></DIV> <H2 id=profiles>Profiles</H2> <P>Use <CODE>--profile</CODE> to maintain separate watchlists for different people:</P><PRE><CODE class=language-bash>python3 {baseDir}/scripts/libby-book-monitor.py --profile jane watch "Dune" python3 {baseDir}/scripts/libby-book-monitor.py --profile bob check --notify </CODE></PRE> <H2 id=configuration>Configuration</H2> <P>Default library is <CODE>telaviv</CODE> Israel Digital. Edit <CODE>~/.libby-book-monitor/config.json</CODE> to change:</P><PRE><CODE class=language-json>{ "default_library": "nypl", "libraries": { "nypl": "New York Public Library" } } </CODE></PRE> <P>The library code is the subdomain from your library's OverDrive site (e.g., <CODE>nypl.overdrive.com</CODE> -> <CODE>nypl</CODE>).</P> <H2 id=cron-integration>Cron Integration</H2> <P>Run a daily check that only outputs when books are newly found:</P><PRE><CODE class=language-bash>python3 {baseDir}/scripts/libby-book-monitor.py --profile jane check --notify </CODE></PRE> <P>If any new books are found, send the results to the user.</P> <H2 id=notes>Notes</H2> <UL> <LI>Works with non-Latin scripts (Hebrew, Arabic, CJK, etc.)</LI> <LI>Books are considered "found" when <CODE>isOwned: true</CODE> in the API response</LI> <LI>1-second delay between API calls when checking multiple books</LI> <LI>No external dependencies (Python stdlib only)</LI> <LI>Data stored in <CODE>~/.libby-book-monitor/</CODE> (configurable via <CODE>--data-dir</CODE> or <CODE>$LIBBY_BOOK_MONITOR_DATA</CODE>)</LI></UL> </div> <div class="lastanext flexRow"> <a class="lastart flexRow" href="/wz/340009.html" ><span>上一篇:</span><span>ClawVault:便携式智能体身份与记忆同步 - Openclaw Skills</span></a> <a class="nextart flexRow" href="/wz/340011.html" ><span>下一篇:</span><span>Jarvis API 合约守卫:API 稳定性与兼容性 - Openclaw 技能</span></a> </div> </div> <div class="dtl-xgtj"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>相关推荐</p></div> </div> <div class="tjlist flexRow"> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/340233.html" > <img src="https://images.jiaoben.net/uploads/20260331/logo_69caf59d9737c1.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/340233.html" >2026年云原生开发者调查报告:平台工程采用现状与成熟度分析</a> <a class="imdtrap flexRow overflowclass" href="/wz/340233.html" > 2026年云原生开发者调查报告分析了平台工程在三大领域的采用现状与成熟度。报告评估了工作流自动化、应用交付及安全合规管理的核心工具,包括GitHub Actions、Helm、Keycloak等技术的实用性与稳定性。数据显示Armada成熟度最高,而新兴工具Crossplane和kro获得开发者高度推荐。41%组织采用多团队协作平台模式,35%选择混合平台应对AI工作流挑战。 </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-03-31</span></p> </div> <a href="/wz/340233.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/340232.html" > <img src="https://images.jiaoben.net/uploads/20260331/logo_69caf59801e981.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/340232.html" >软件所发布首个本地通用幻灯片智能体模型及环境系统开源版本</a> <a class="imdtrap flexRow overflowclass" href="/wz/340232.html" > 中国科学院软件研究所开源第二代幻灯片智能体系统PPTagent,首次实现智能体模型与沙箱环境同步开源。该系统通过环境感知反思机制优化排版流程,集成20余种专业工具确保内容专业性,支持消费级显卡部署并适配国产算力生态。9B版本在测试中接近闭源模型表现,提供可编辑pptx格式输出。 </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-03-31</span></p> </div> <a href="/wz/340232.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/340231.html" > <img src="https://images.jiaoben.net/uploads/20260331/logo_69caf5928684f1.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/340231.html" >中国科学院开启新一代开源芯片与系统技术攻关</a> <a class="imdtrap flexRow overflowclass" href="/wz/340231.html" > 中国科学院发布香山开源处理器与如意原生操作系统,标志着我国在RISC-V芯片架构与系统技术领域取得重大突破。新一代开源芯片性能达国际先进水平,实现规模化产业落地,有效降低企业研发成本。产学研联合启动昆明湖架构研发,加速构建自主可控的芯片与操作系统生态体系。 </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-03-31</span></p> </div> <a href="/wz/340231.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/340230.html" > <img src="https://images.jiaoben.net/uploads/20260331/logo_69caf58d530671.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/340230.html" >林俊旸最新文章探讨从推理式思考到智能体式思考的演进</a> <a class="imdtrap flexRow overflowclass" href="/wz/340230.html" > 林俊旸最新文章深入探讨人工智能从推理式思考到智能体式思考的演进过程。文章指出第一波推理模型验证了强化学习的价值,但行业将转向通过与真实环境交互并持续修正策略的智能体思维。分析了Qwen3融合思考与指令模式的结构性矛盾,强调智能体时代需要更关注环境质量、工具工程和多智能体协调。核心观点是未来竞争优势将来自环境设计和服务集成能力。 </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-03-31</span></p> </div> <a href="/wz/340230.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> </div> </div> </div> <div class="cd-right dtlcd-right"> <div class="dtl-ht"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>专题</p></div> </div> <div class="dtlht-list "> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50161.html" >#Grok</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50161.html" >Grok脚本资源网站,提供G</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50161" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50160.html" >#Sora2</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50160.html" >Sora2脚本资源网站,提供S</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50160" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50159.html" >#通义万相</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50159.html" >通义万相脚本资源网站,提供通</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50159" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50158.html" >#海螺AI</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50158.html" >海螺AI脚本资源网站,提供海</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50158" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50157.html" >#可灵AI</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50157.html" >可灵AI脚本资源网站,提供可</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50157" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-50156.html" >#Kling3.0</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-50156.html" >Kling3.0脚本资源网站,提</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="50156" >+ 收藏</p> </div> </div> </div> <div class=" dtl-zt"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>最新数据</p></div> </div> <div class="wkch-downs"> <div class="weekch-top flexRow"> <a class="wktpa flexRow" href="/wz/340016.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="wktpa-right flexColumn"> <a class="wktpara flexRow overflowclass" href="/wz/340016.html" >Ressemble AI:为 Openclaw Skills 提供专业的 TTS 和 STT</a> <a class="wktparp flexRow overflowclass" href="/wz/340016.html" > 什么是 Ressemble A </a> </div> </div> <div class="weekch-list"> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340015.html" class="weekcha flexRow flexcenter overflowclass" >mem9:AI 智能体的持久化云端记忆 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340014.html" class="weekcha flexRow flexcenter overflowclass" >SkillGuard:面向 Openclaw Skills 的 AI 驱动安全扫描器</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340013.html" class="weekcha flexRow flexcenter overflowclass" >Meditate:主动式 AI 反思与见解生成 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340012.html" class="weekcha flexRow flexcenter overflowclass" >UniOne Email API:高送达率事务性邮件 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340008.html" class="weekcha flexRow flexcenter overflowclass" >OpenClaw 静默自动更新:自动化 CLI 维护 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340007.html" class="weekcha flexRow flexcenter overflowclass" >Geepers Corpus:语言分析与 COCA 集成 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/340006.html" class="weekcha flexRow flexcenter overflowclass" >教会账户自动化:管理 LDS 和 LCR 任务 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/339998.html" class="weekcha flexRow flexcenter overflowclass" >我做了一个专为油猴打造的轻量级 Vue 组件注入库</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/339997.html" class="weekcha flexRow flexcenter overflowclass" >纯干货,前端字体极致优化!谷歌、阿里、字节、腾讯都在用的终极解决方案,Vue3 + Vite 直接抄,页面提速不妥协!</a> </div> </div> </div> </div> <div class=" dtl-wz"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>相关文章</p></div> </div> <div class="blog-list"> <a href="/wz/339873.html" class="bloga flexRow over"><p class="overflowclass">DHT11 传感器集成:温湿度监控 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339874.html" class="bloga flexRow over"><p class="overflowclass">自动推文调度器:Twitter 内容管理 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339875.html" class="bloga flexRow over"><p class="overflowclass">膳食规划器:自动化的每周菜单和购物清单 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339876.html" class="bloga flexRow over"><p class="overflowclass">verify-claim: 实时事实核查与数据验证 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339877.html" class="bloga flexRow over"><p class="overflowclass">Jarvis 事故时间线编写器:自动化技术工作流 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339878.html" class="bloga flexRow over"><p class="overflowclass">DuckDuckGo 网页搜索:AI 智能体私密搜索 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339879.html" class="bloga flexRow over"><p class="overflowclass">Peloton 统计:通过 API 追踪骑行表现 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339880.html" class="bloga flexRow over"><p class="overflowclass">TS4:TypeScript 单元、快照及变异测试 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339881.html" class="bloga flexRow over"><p class="overflowclass">HFT 模拟交易员:自主加密货币交易技能 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> <a href="/wz/339882.html" class="bloga flexRow over"><p class="overflowclass">Fork 与技能扫描器终极版:GitHub 洞察自动化 - Openclaw Skills</p><div class="blogtime"><span>03/</span>31</div></a> </div> </div> <div class="cdr-ai"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>AI精选 </p></div> <a class="jbtitle-more flexRow" href="/category/list_344_1.html" title=""><span>更多</span><b></b></a> </div> <div class="ai-list"> <div class="ail-top flexRow"> <a href="/wz/338861.html" title="" class="ailta "> <img src="https://images.jiaoben.net/uploads/20260330/logo_69ca6dbe5ca4c1.jpeg" > <p ><span>MCP 协议深度解析:构建 A</span></p></a> <a href="/wz/338859.html" title="" class="ailta "> <img src="https://images.jiaoben.net/uploads/20260330/logo_69ca6db7dd5131.jpeg" > <p ><span>OpenClaw 真正的效率开</span></p></a> </div> <div class="ail-down"> <a class="ali-con flexRow" href="/wz/338843.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">Anthropic 的 Harness 启示:当 AI Agent 开始「长跑」,架构才是真正的天花板</p> </a> <a class="ali-con flexRow" href="/wz/338751.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">AI Agent 智能体 - Multi-Agent 架构入门</p> </a> <a class="ali-con flexRow" href="/wz/338691.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">RAG 不一定非得靠向量库:一套更偏工程落地的“结构化推理检索”方案</p> </a> <a class="ali-con flexRow" href="/wz/338690.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">一文搞懂深度学习中的池化!</p> </a> <a class="ali-con flexRow" href="/wz/338689.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">一文搞懂卷积神经网络经典架构-LeNet</p> </a> <a class="ali-con flexRow" href="/wz/338460.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">告别 Vibe Coding:用 SDD 让 AI 编程提效 50%,三工具实战对比</p> </a> <a class="ali-con flexRow" href="/wz/338458.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">Agent 语音交互如何更稳、更快?一次高并发消息链路优化实践</p> </a> <a class="ali-con flexRow" href="/wz/338457.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass"># AI 终于能"干活"了——Function Calling 完全指南</p> </a> </div> </div> </div> <div class="cdr-blog"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>脚本推荐</p></div> </div> <div class="blog-list"> <a href="/wz/zt-49225.html" title="" class="bloga flexRow over"><p class="overflowclass">SeeDance 2.0 Video Creator专区</p></a> <a href="/wz/zt-49224.html" title="" class="bloga flexRow over"><p class="overflowclass">OpenClaw AI专区</p></a> <a href="/wz/zt-49223.html" title="" class="bloga flexRow over"><p class="overflowclass">cowork专区</p></a> <a href="/wz/zt-49222.html" title="" class="bloga flexRow over"><p class="overflowclass">claude code skills专区</p></a> </div> </div> </div> </div> </div> </div> </main> <script> $(function() { // “+ 收藏”按钮点击事件 $(document).on('click', '.htmitem-right, .ztop-right', function(e) { // 仅针对包含 “+ 收藏” 文字的按钮 if ($(this).text().indexOf('+ 收藏') === -1) return; e.preventDefault(); const id = $(this).data('id'); if (!id) { layer.msg('该项暂无有效ID,无法收藏'); return; } // 构造收藏 URL: 当前域名 + /wz/zt- + id + / const bookmarkUrl = window.location.origin + '/wz/zt-' + id + '.html'; // 获取收藏标题 (优先从同级元素获取话题名称,否则使用页面标题) let bookmarkTitle = $(this).closest('.htl-item, .zttopd').find('a:first, span.overflowclass').text().trim() || document.title; if (bookmarkTitle.startsWith('#')) bookmarkTitle = bookmarkTitle.substring(1); // 浏览器收藏逻辑 (带 Fallback) try { if (window.sidebar && window.sidebar.addPanel) { // Firefox < 23 window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, ""); } else if (window.external && ('AddFavorite' in window.external)) { // IE window.external.AddFavorite(bookmarkUrl, bookmarkTitle); } else { // Chrome, Safari, Firefox 23+, etc. const isMac = /Mac/i.test(navigator.userAgent); const keyStr = isMac ? 'Command + D' : 'Ctrl + D'; layer.confirm('由于浏览器安全限制,请使用 <b>' + keyStr + '</b> 手动添加收藏。<br><br>收藏地址:<br><small>' + bookmarkUrl + '</small>', { title: '收藏提示', btn: ['复制链接', '知道了'], yes: function(index) { copyToClipboard(bookmarkUrl).then(() => { layer.msg('链接已复制,请手动添加到收藏夹'); }).catch(() => { layer.msg('复制失败,请手动选择复制'); }); layer.close(index); } }); } } catch (err) { layer.msg('收藏失败,请手动添加'); } }); // 兼容非 HTTPS 的复制函数 function copyToClipboard(text) { if (navigator.clipboard && window.isSecureContext) { return navigator.clipboard.writeText(text); } else { let textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position = "fixed"; textArea.style.left = "-999999px"; textArea.style.top = "-999999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); return new Promise((res, rej) => { document.execCommand('copy') ? res() : rej(); textArea.remove(); }); } } }); </script> <footer> <div class="foot "> <div class="foot-top flexRow"> <div class="foot-left"> <div class="ftl-top flexRow"><span class="flexRow flexcenter">脚本</span>在线</div> <p class="ftl-down"> 智能赋能梦想,脚本构筑现实。我们致力于链接AI智能指令 与传统自动化,为您提供一站式、高效率的脚 本资产与生成 服务。 </p> </div> <div class="foot-right flexRow"> <div class="ftr-list flexColumn"> <p>核心板块</p> <span>AI脚本库</span> <span>自动化仓库</span> <span>脚本实验室</span> </div> <div class="ftr-list flexColumn"> <p>关于我们</p> <a href="/category/list_229_1.html" >最新游戏</a> <span>商务合作</span> <span>隐私政策</span> </div> <div class="ftr-list flexColumn"> <p>社区支持</p> <span >API文档</span> <a href="/category/list_334_1.html" >攻略资讯</a> <span>违规举报</span> </div> </div> </div> <div class="foot-down flexColumn"> <p>© 2026 jiaoben.net | 脚本在线 | 联系:jiaobennet2026@163.com</p> <p>备案:<a style="color: #7F7F7F;" href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">湘ICP备18025217号-11</a> </p> </div> </div> </footer> </body> </html>