IP地址 | 服务器名称 | 所属国家 |
---|---|---|
3.127.119.2 | ec2-3-127-119-2.eu-central-1.compute.amazonaws.com | DE |
62.138.3.191 | astra4433.startdedicated.de | FR |
IP地址 | 服务器名称 | 所属国家 |
---|---|---|
195.154.133.41 | 195-154-133-41.rev.poneytelecom.eu | FR |
IP地址 | 服务器名称 | 所属国家 |
---|---|---|
104.207.143.191 | ? | US |
IP地址 | 服务器名称 | 所属国家 |
---|---|---|
212.251.196.81 | ? | NO |
84.202.187.83 | ? | NO |
95.34.60.49 | 49.60.34.95.customer.cdi.no | NO |
一个易于使用、可扩展的 robots.txt
解析器库,完全支持互联网上的所有指令和规范。
用例:
robots.txt
渲染(与大多数其他 robots.txt 库相比)
robots.txt
。(可选)User-Agent
分析器和组确定器库,以获得最大的准确性。要求:
The recommended way to install the robots.txt parser is through Composer. Add this to your composer.json
file:
安装 robots.txt 解析器的推荐方式是通过 Composer。在你的 composer.json
文件中加入以下内容。
{ "require": { "vipnytt/robotstxtparser": "^2.1" } }
然后运行: php composer update
<?php $client = new vipnytt\RobotsTxtParser\UriClient('http://example.com'); if ($client->userAgent('MyBot')->isAllowed('http://example.com/somepage.html')) { // Access is granted } if ($client->userAgent('MyBot')->isDisallowed('http://example.com/admin')) { // Access is denied }
<?php // Syntax: $baseUri, [$statusCode:int|null], [$robotsTxtContent:string], [$encoding:string], [$byteLimit:int|null] $client = new vipnytt\RobotsTxtParser\TxtClient('http://example.com', 200, $robotsTxtContent); // Permission checks $allowed = $client->userAgent('MyBot')->isAllowed('http://example.com/somepage.html'); // bool $denied = $client->userAgent('MyBot')->isDisallowed('http://example.com/admin'); // bool // Crawl delay rules $crawlDelay = $client->userAgent('MyBot')->crawlDelay()->getValue(); // float | int // Dynamic URL parameters $cleanParam = $client->cleanParam()->export(); // array // Preferred host $host = $client->host()->export(); // string | null $host = $client->host()->getWithUriFallback(); // string $host = $client->host()->isPreferred(); // bool // XML Sitemap locations $host = $client->sitemap()->export(); // array
以上只是一个基本的尝试,还有一大堆更高级和/或专门的方法,几乎可以用于任何目的。请访问小抄以了解技术细节。
请访问文档以了解更多信息。