php 在线错误检查工具,Fink一个PHP编写的命令行工具用于检查网站是否有错误的页面或链接...

Fink

68747470733a2f2f7472617669732d63692e6f72672f64616e746c656563682f66696e6b2e7376673f6272616e63683d6d6173746572

Fink (pronounced "Phpink") is a command line tool for checking HTTP links written in PHP.

Check websites for broken links or error pages.

Asynchronous HTTP requests.

b71b97bff2eefd7e719e3572f8ebe02d.gif

Installation

Install as a stand-alone tool or as a project dependency:

Installing as a project dependency

$ composer require dantleech/fink --dev

Installing from a PHAR

Download the PHAR from the Releases page.

Building your own PHAR with Box

You can build your own PHAR by cloning this repository and running:

$ ./vendor/bin/box compile

Usage

Run the command with a single URL to start crawling:

$ ./vendor/bin/fink https://www.example.com

Use --output=somefile to log verbose information for each URL in JSON format, including:

url: The tested URL.

status: The HTTP status code.

referrer: The page which linked to the URL.

referrer_title: The value (e.g. link title) of the referring element.

referrer_xpath: The path to the node in the referring document.

distance: The number of links away from the start document.

request_time: Number of microseconds taken to make the request.

timestamp: The time that the request was made.

exception: Any runtime exception encountered (e.g. malformed URL, etc).

Arguments

url (multiple) Specify one or more base URLs to crawl (mandatory).

Options

--client-max-body-size 'Max body size for HTTP client (in bytes).

--client-max-header-size 'Max header size for HTTP client (in bytes).

--client-redirects=5 Set the maximum number of times the client should redirect (0 to never redirect).

--client-security-level=1 Set the default SSL security level

--client-timeout=15000 Set the maximum amount of time (in milliseconds) the client should wait for a response, defaults to 15,000 (15 seconds).

--concurrency: Number of simultaneous HTTP requests to use.

--display-bufsize=10 Set the number of URLs to consider when showing the display.

--display=+memory Set, add or remove elements of the runtime display (prefix with - or + to modify the default set).

--exclude-url=logout (multiple) Exclude URLs matching the given PCRE pattern.

--header="Foo: Bar" (multiple) Specify custom header(s).

--include-link=foobar.html Include given link as if it were linked from the base URL.

--insecure: Do not verify SSL certificates.

--load-cookies: Load from a cookies.txt.

--max-distance: Maximum allowed distance from base URL (if not specified then there is no limitation).

--max-external-distance: Limit the external (disjoint) distance from the base URL.

--no-dedupe: Do not filter duplicate URLs (can result in a non-terminating process).

--output=out.json: Output JSON report for each URL to given file (truncates existing content).

--publisher=csv Set the publisher (defaults to json) can be either json or csv.

--rate Set a maximum number of requests to make in a second.

--stdout Stream to STDOUT directly, disables display and any specified outfile.

Examples

Crawl a single website

$ fink http://www.example.com --max-external-distance=0

Crawl a single website and check the status of external links

$ fink http://www.example.com --max-external-distance=1

Use jq to analyse results

jq is a tool which can be used to query and manipulate JSON data.

$ fink http://www.example.com -x0 -oreport.json

$ cat report.json| jq -c '. | select(.status==404) | {url: .url, referrer: .referrer}' | jq

Exit Codes

0: All URLs were successful.

1: Unexpected runtime error.

2: At least one URL failed to resolve successfully.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值