Skip to content

Commit ee2cd4c

Browse files
committed
Documentation
1 parent 07a4d9d commit ee2cd4c

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

docs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
## Create an `robots.txt` parser instance
88
You have 3 different ways to construct the `robots.txt` parser, each suited for different demands.
9-
### Automatic download
9+
### - Automatic download
1010
```php
1111
$client = new \vipnytt\RobotsTxtParser\UriClient('http://example.com');
1212
```
1313
- [Documentation + additional UriClient specific methods](methods/UriClient.md).
1414
- [Usage examples](#uriclient)
1515

16-
### Custom `robots.txt` input
16+
### - Custom `robots.txt` input
1717
```php
1818
$robotsTxt = "
1919
User-agent: *
@@ -26,7 +26,7 @@ $client = new \vipnytt\RobotsTxtParser\TxtClient('http://example.com', 200, $rob
2626
- [Documentation](methods/TxtClient.md).
2727
- [Usage examples](#txtclient)
2828

29-
### The integrated caching system
29+
### - The integrated caching system
3030
```php
3131
$pdo = new PDO('mysql:host=127.0.0.1;dbname=database', 'username', 'password');
3232
$handler = new \vipnytt\RobotsTxtParser\Cache($pdo);
@@ -39,6 +39,7 @@ $client = $handler->client('http://example.com');
3939
## The Delay handler
4040
The Delay class is mainly for administration purposes, but may also be used as an alternative way to handle delays. It is generally not needed, but available usage examples are shown below.
4141
```php
42+
$pdo = new PDO('mysql:host=127.0.0.1;dbname=database', 'username', 'password');
4243
$delayHandler = new \vipnytt\RobotsTxtParser\Delay($pdo);
4344
```
4445
- [Set-up instructions](sql/delay.md).

docs/sql/cache.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ Multiple crawlers may with benefits share the same database.
99
### Requirements:
1010
- MySQL
1111

12-
Support for additional databases is possible, just [submit an issue](https://github.com/VIPnytt/RobotsTxtParser/issues) and we'll see what we can do about it.
12+
The library is built with cross-system in mind, and everything is set for additional database support. Just [submit an issue](https://github.com/VIPnytt/RobotsTxtParser/issues) and we'll see what we can do about it.
1313

1414
## Usage
1515
```php
1616
$handler = new RobotsTxtParser\Cache($pdo);
1717
$client = $handler->client('http://example.com');
1818
```
1919

20+
See the [Cache class documentation](../methods/Cache.md) for more information and additional available methods.
21+
2022
#### Cron job
2123
Recommended, but not required.
2224

docs/sql/delay.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Delay handler
22
Many hosts requires you to control the robot's request flow, using a minimum interval between each request. The reasons for this isn't always obvious, and may sometimes be complicated.
33

4+
Did you know this number is as high as about 40% of all `robots.txt` files?
5+
_Source: internal statistics_
6+
47
Examples of a 5 second interval:
58
- [`Crawl-delay: 5`](../directives.md#crawl-delay)
69
- [`Cache-delay: 5`](../directives.md#cache-delay)
@@ -12,9 +15,12 @@ Multiple _user-agents_ / _crawlers_ may share the same database. The delay is ha
1215
### Requirements
1316
- MySQL 5.6+
1417

15-
Support for additional databases is possible, just [submit an issue](https://github.com/VIPnytt/RobotsTxtParser/issues) and we'll see what we can do about it.
18+
The library is built with cross-system in mind, and everything is set for additional database support. Just [submit an issue](https://github.com/VIPnytt/RobotsTxtParser/issues) and we'll see what we can do about it.
1619

1720
## Usage
21+
- See the [DelayInterface](../methods/DelayInterface.md) for client usage
22+
- See the [Delay class](../methods/Delay.md) for management
23+
1824
#### Automated
1925
Sleep until the timestamp is reached
2026
```php

0 commit comments

Comments
 (0)