File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments