检查损坏文件_链接检查器损坏

检查损坏文件

Broken Link Checker by Steven Vachon is an outstanding Node.js-powered utility for recursively checking for broken links on a website.  Broken links lead to bad user experiences and mistrust -- two things that can cost you money and other types of conversion.  The broken link checker has two methods of use:  command line and a Node.js API.

Steven Vachon开发的Broken Link Checker是一款出色的Node.js驱动的实用程序,用于递归检查网站上的断开链接。 链接断开会导致不良的用户体验和不信任感-两件事可能会花费您金钱和其他类型的转换。 断开的链接检查器有两种使用方法:命令行和Node.js API。

从命令行使用断开的链接检查器 (Using Broken Link Checker from Command Line)

Broken Link Checker can be used from command line if you install with Node.js:

如果与Node.js一起安装,则可以从命令行使用Broken Link Checker:


npm install -g broken-link-checker


With the utility globally available, we can execute commands like this one to trigger broken link checking:

使用该实用程序在全球范围内可用,我们可以执行像这样的命令来触发断开的链接检查:


blc https://davidwalsh.name -ro


...which triggers a streaming list of results within your command line:

...这会在您的命令行中触发结果流列表:

Broken Link Checker

This is the fastest and easiest way to quickly check for broken links!

这是快速检查断开链接的最快,最简单的方法!

程序化断开链接检查器的用法 (Programmatic Broken Link Checker Usage)

Broken Link Checker allows you to use its awesome, highly customizable API to do your own automation of broken link checking.  Here's a quick look at the API:

Broken Link Checker允许您使用其功能强大,可高度自定义的API来自动进行断开链接检查。 快速浏览一下API:


// Scans an HTML document to find broken links.
var htmlChecker = new blc.HtmlChecker(options, {
    html: function(tree, robots){},
    junk: function(result){},
    link: function(result){},
    complete: function(){}
});
htmlChecker.scan(html, baseUrl);

// Scans the HTML content at each queued URL to find broken links.
var htmlUrlChecker = new blc.HtmlUrlChecker(options, {
    html: function(tree, robots, response, pageUrl, customData){},
    junk: function(result, customData){},
    link: function(result, customData){},
    page: function(error, pageUrl, customData){},
    end: function(){}
});
htmlUrlChecker.enqueue(pageUrl, customData);

// Recursively scans (crawls) the HTML content at each queued URL to find broken links.
var siteChecker = new blc.SiteChecker(options, {
    robots: function(robots, customData){},
    html: function(tree, robots, response, pageUrl, customData){},
    junk: function(result, customData){},
    link: function(result, customData){},
    page: function(error, pageUrl, customData){},
    site: function(error, siteUrl, customData){},
    end: function(){}
});
siteChecker.enqueue(siteUrl, customData);

// Requests each queued URL to determine if they are broken.
var urlChecker = new blc.UrlChecker(options, {
    link: function(result, customData){},
    end: function(){}
});
urlChecker.enqueue(url, baseUrl, customData);

// Handle broken links
if (result.broken) {
    console.log(result.brokenReason);
    //=> HTTP_404
} else if (result.excluded) {
    console.log(result.excludedReason);
    //=> BLC_ROBOTS
}


This broken link checker API also allows for header and advanced options with everything from redirect management, keywords, cache options, and more.  Broken Link Checker has everything!

这个断开的链接检查器API还允许使用标头和高级选项,其中包括重定向管理,关键字,缓存选项等等。 损坏的链接检查器拥有一切!

翻译自: https://davidwalsh.name/broken-link-checker

检查损坏文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值