惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
Cisco Talos Blog
Cisco Talos Blog
Y
Y Combinator Blog
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy & Cybersecurity Law Blog
L
LangChain Blog
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
F
Full Disclosure
S
Schneier on Security
T
Tenable Blog
量子位
NISL@THU
NISL@THU
Latest news
Latest news
V
Visual Studio Blog
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
博客园_首页
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
美团技术团队
P
Proofpoint News Feed
P
Palo Alto Networks Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
AWS News Blog
AWS News Blog
S
Securelist
The Register - Security
The Register - Security
G
GRAHAM CLULEY
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
C
Cisco Blogs

无名博客

如何利用 3D 打印机热床来烘干耗材 - 无名博客 解决 CyberChef 解码 ROT13 后出现乱码的问题 - 无名博客 如何在树莓派 4B 上驱动一块 2.4 寸 SPI 屏幕 - 无名博客 如何从 ClawCloud Run 爪云迁移 n8n 到自托管 Docker - 无名博客 DIY 维修数控电子防潮柜 更换制冷片记录 - 无名博客 只需不到十元 用 RP2040 DIY 一条 YubiKey FIDO2 物理密钥 - 无名博客 为解决晚上睡觉途中突然亮灯 再次购入小米人体感应器一枚 - 无名博客 Home Assistant 配合小米人体传感器 2s 实现人走关灯 - 无名博客 Home Assistant 绑定米家账号后怎么刷新设备列表 - 无名博客 如何解决 Matomo 统计的历史数据突然变成 0 访客 - 无名博客 WordPress 优化 – 把博客的图片挂载到免费的 Cloudflare R2 储存桶 - 无名博客 如何使用 Rclone 下载 Google Drive 分享链接内的文件 - 无名博客 WordPress 优化 – 后台禁用 Ctrl+K 快捷键控制面板 - 无名博客 通过 Portainer 更新 Docker 容器镜像/重新拉取镜像 - 无名博客 Remotely – 群晖 NAS 自建免费远程控制软件 - 无名博客
利用 n8n 工作流实现定时检测友链状态 - 无名博客
wmbk · 2026-03-11 · via 无名博客

博客的友链不时会出现死链,网站打不开等的状态,本来想着用 UptimeRobot 这类网站监控工具来监控但是手动同步友链列表又比较麻烦,所以就改为用 n8n 工作流来定时自动获取友情链接列表,再自动逐一检测状态并筛选失效链接推送,用了点时间弄出来一个工作流,如果你有类似需求可以参考看看 🙂


先看截图:

逐一说明:

  1. 定时触发:每 10 小时触发运行
  2. HTTP 请求:发送请求到博客的友链页面(https://wuminboke.site/misc),失败重试三遍;这里需要注意如果你的博客开了 CF 5 秒盾或者类似检测,需要调整一下 WAF 规则
  3. JS 代码:提取<li>里的<a>标签,并且排除掉博客自身的域名:
    const html = $input.first().json.data
    const regex = /<li[^>]*>\s*<a\s+[^>]*href=["']?([^"'\s>]+)["']?[^>]*>/gi;
    const excludedDomains = ['wuminboke.site']; //排除自己的博客域名
    const hrefs = [];
    let match;
    while ((match = regex.exec(html)) !== null) {
      const href = match[1];
      const isExcluded = excludedDomains.some(domain => href.includes(domain));
      if (!isExcluded) {
        hrefs.push(href);
      }
    }
    return hrefs.map(href => ({ json: { href } }));
  4. HTTP 请求:逐一发送 GET 请求到 {{ $json.href }} ,并且把设置里的 On Error 改为 Continue (using error output),错误时继续
  5. 如果:把上一步的 Error 拉到如果,配置 {{ $input.all().length }} # is equal to 0,判断有无错误
  6. JS 代码:如果上一步“如果”的结果是“否”,那么把错误的网址和错误码拼起来:
    const items = $input.all();
    const lines = items.map(item => {
      const href = item.json.href;
      const status = item.json.error?.status ? ` ${item.json.error.status}` : '';
      return `${status}\n ${href}`;
    });
    const message = `检测完成 (共有${lines.length}个错误)\n\n` + lines.join('\n\n');
    return [{ json: { message } }];
  7. TG 推送:利用 TG 机器人发送通知(我在消息前还加了时间,但是不是必要的);在@BotFather 创建机器人获取 Token 并用@userinfobot 获取账号的聊天 ID

不想自己托管 n8n 的可以找找那些免费 Docker 容器服务,比如 ClawCloud 绑定 GitHub 后就有免费的额度可以用 😛


Web hosting by ServerSpan