Skip to content

Commit e06ed9e

Browse files
committed
Readme update
1 parent 80c293f commit e06ed9e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The recommended way to install the robots.txt parser is through [Composer](http:
3636
```json
3737
{
3838
"require": {
39-
"vipnytt/robotstxtparser": "0.1.*"
39+
"vipnytt/robotstxtparser": "~1.0"
4040
}
4141
}
4242
```
@@ -47,10 +47,10 @@ Then run: ```php composer.phar update```
4747
```php
4848
$client = new vipnytt\RobotsTxtParser\Client('http://example.com');
4949

50-
if ($client->userAgent('MyBot')->isAllowed('/somepage.html')) {
50+
if ($client->userAgent('MyBot')->isAllowed('http://example.com/somepage.html')) {
5151
// Access is granted
5252
}
53-
if ($client->userAgent('MyBot')->isDisallowed('/admin')) {
53+
if ($client->userAgent('MyBot')->isDisallowed('http://example.com/admin')) {
5454
// Access is denied
5555
}
5656
```
@@ -60,8 +60,8 @@ if ($client->userAgent('MyBot')->isDisallowed('/admin')) {
6060
$client = new vipnytt\RobotsTxtParser\Client('http://example.com', 200, $robotsTxtContent);
6161

6262
// Permission checks
63-
$allowed = $client->userAgent('MyBot')->isAllowed('/somepage.html'); // bool
64-
$denied = $client->userAgent('MyBot')->isDisallowed('/admin'); // bool
63+
$allowed = $client->userAgent('MyBot')->isAllowed('http://example.com/somepage.html'); // bool
64+
$denied = $client->userAgent('MyBot')->isDisallowed('http://example.com/admin'); // bool
6565

6666
// Crawl delay rules
6767
$crawlDelay = $client->userAgent('MyBot')->getCrawlDelay(); // int | float

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"php": ">=5.6.0",
3939
"ext-mbstring": "*",
4040
"guzzlehttp/guzzle": "6.*",
41-
"vipnytt/useragentparser": "0.2.*"
41+
"vipnytt/useragentparser": "~0.2"
4242
},
4343
"require-dev": {
4444
"phpunit/phpunit": ">=4.0",

0 commit comments

Comments
 (0)