博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
检查损坏文件_链接检查器损坏
阅读量:2513 次
发布时间:2019-05-11

本文共 3099 字,大约阅读时间需要 10 分钟。

检查损坏文件

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开发的是一款出色的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 linksif (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还允许使用标头和高级选项,其中包括重定向管理,关键字,缓存选项等等。 损坏的链接检查器拥有一切!

翻译自:

检查损坏文件

转载地址:http://tfvwd.baihongyu.com/

你可能感兴趣的文章
2015年创业中遇到的技术问题:21-30
查看>>
《社交红利》读书总结--如何从微信微博QQ空间等社交网络带走海量用户、流量与收入...
查看>>
JDK工具(一)–Java编译器javac
查看>>
深入.NET框架与面向对象的回顾
查看>>
改变label中的某字体颜色
查看>>
七牛云存储之应用视频上传系统开心得
查看>>
struts2日期类型转换
查看>>
Spark2-数据探索
查看>>
Http和Socket连接区别
查看>>
Angular2,Springboot,Zuul,Shiro跨域CORS请求踩坑实录
查看>>
C语言中操作符的优先级大全
查看>>
pgpool-II - 介绍
查看>>
Alpha冲刺(10/10)——2019.5.2
查看>>
图书管理系统用例
查看>>
Microsoft patterns & practices 学习笔记(0)
查看>>
在腾讯云上创建您的SQL Cluster(4)
查看>>
部署在腾讯云的公益网站遭受了一次CC攻击
查看>>
linux ping命令
查看>>
Activiti源码浅析:Activiti的活动授权机制
查看>>
数位dp整理
查看>>