2017 © Pedro Peláez
 

library robots-txt

Robots.txt parser

image

innmind/robots-txt

Robots.txt parser

  • Monday, October 2, 2017
  • by Baptouuuu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 156 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 11 % Grown

The README.md

Robots.txt

codecov Build Status Type Coverage, (*1)

Robots.txt parser, (*2)

Installation

composer require innmind/robots-txt

Usage

use Innmind\RobotsTxt\Parser;
use Innmind\OperatingSystem\Factory;
use Innmind\Url\Url;

$os = Factory::build();
$parse = Parser::of(
    $os->remote()->http(),
    'My user agent',
);
$robots = $parse(Url::of('https://github.com/robots.txt'))->match(
    static fn($robots) => $robots,
    static fn() => throw new \RuntimeException('robots.txt not found'),
);
$robots->disallows('My user agent', Url::of('/humans.txt')); //false
$robots->disallows('My user agent', Url::of('/any/other/url')); //true

[!NOTE] Here only the path /humans.txt is allowed because by default github disallows any user agent to crawl there website except for this file., (*3)

The Versions

02/10 2017

dev-master

9999999-dev

Robots.txt parser

  Sources   Download

MIT

The Requires

 

The Development Requires

02/10 2017

3.0.0

3.0.0.0

Robots.txt parser

  Sources   Download

MIT

The Requires

 

The Development Requires

02/10 2017

dev-develop

dev-develop

Robots.txt parser

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2017

2.0.0

2.0.0.0

Robots.txt parser

  Sources   Download

MIT

The Requires

 

The Development Requires

05/02 2017

1.0.0

1.0.0.0

Robots.txt parser

  Sources   Download

MIT

The Requires

 

The Development Requires