360 Secure SkillHub
360 安全技能中心

Link Checker

核心功能:扫描指定目录的HTML文件,检查内外部及联盟链接状态,识别断链、重定向、慢响应链接,按类型和严重程度分组。典型场景:内容发布后验证、定期站点健康审计、联盟营销内容维护(避免佣金损失)。支持全量审计、快速断链检测、仅联盟链接检查三种模式,输入目标目录即可,输出整洁Markdown报告。

kryzl19
kryzl19
热度 43.23
最近更新 2026-05-11 17:36:54
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add strd-link-checker
Metadata
name
link-checker
description
Check all links in a website's HTML files and report broken, redirected, and slow links. Supports internal links, external links, and affiliate link identification. Use after publishing content to verify nothing is broken, or as part of a regular site health audit. Particularly useful for affiliate content where broken product links mean lost commissions.
metadata
{"openclaw":{"requires":{"bins":["curl","python3"]},"install":[]}}

Link Checker

Validate links in HTML files and report issues: broken links (404/500), redirects, slow responses, and affiliate link status.

What This Skill Does

  • Scans all HTML files in a given directory
  • Checks each link (internal + external) for HTTP status
  • Identifies broken (4xx/5xx), redirected (3xx), and slow links (>5s)
  • Groups links by type: internal, external, affiliate
  • Outputs a clean markdown report sorted by severity

Environment Variables

Variable Required Default Description
SITE_DIR Yes — Directory containing HTML files to scan
LINK_CHECK_TIMEOUT No 10 Max seconds to wait per link
AFFILIATE_DOMAINS No see below Comma-separated affiliate domains to flag

Default affiliate domains: amazon.com,hostname/s/aspx,godaddy.com,bluehost.com,digitalocean.com,heroku.com,shopify.com,awin1.com,ref=

Scripts

check.sh — Full Link Audit

./scripts/check.sh [directory]

Output: markdown report with broken links, redirects, slow links, and affiliate links found.

quick.sh — Fast Scan (broken links only)

./scripts/quick.sh [directory]

Only reports 4xx/5xx status links. Skips affiliate and slow link checks.

affiliate.sh — Affiliate Link Report

./scripts/affiliate.sh [directory]

Lists all affiliate links and whether they're reachable. Critical for revenue site maintenance.

Output Format

# Link Checker Report — [site name]
Generated: [timestamp]

## Summary
- Total links checked: N
- Broken: N  🔴
- Redirected: N  🟡
- Slow (>5s): N  🟠
- Affiliate: N  ✅

## Broken Links (4xx/5xx)  🔴
[file] [line] [url] — [status]

## Redirects  🟡
[file] [url] → [destination]

## Slow Links (>5s)  🟠
[file] [url] — [response_time]

## Affiliate Links  ✅
[file] [url]

Example Usage

# Check all articles
SITE_DIR=./site ./scripts/check.sh

# Fast broken-link only
./scripts/quick.sh ./site/articles/

# Affiliate link audit
AFFILIATE_DOMAINS="amazon.com,digitalocean.com,bluehost.com" ./scripts/affiliate.sh ./site

Notes

  • External links are checked with HEAD requests (faster than GET)
  • Broken link reports are prioritized by severity (5xx worse than 4xx)
  • Affiliate links are flagged but marked ✅ to confirm they're present
  • Run this after any major content update to catch broken links before Google does