-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parsing sitemaps feature. Also, the required PHP version is now 8.0.
- Loading branch information
Showing
13 changed files
with
111 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,15 @@ | ||
<p align="center"><a href="https://www.crwlr.software" target="_blank"><img src="https://github.com/crwlrsoft/graphics/blob/eee6cf48ee491b538d11b9acd7ee71fbcdbe3a09/crwlr-logo.png" alt="crwlr.software logo" width="260"></a></p> | ||
|
||
# Robots Exclusion Standard/Protocol Parser | ||
## for Web Crawling/Scraping | ||
|
||
Use this library within crawler/scraper programs to parse robots.txt | ||
files and check if your crawler user-agent is allowed to load certain | ||
paths. | ||
|
||
## Requirements | ||
|
||
Requires PHP version 7.4 or above. | ||
|
||
## Installation | ||
|
||
Install the latest version with: | ||
|
||
```sh | ||
composer require crwlr/robots-txt | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
use Crwlr\RobotsTxt\RobotsTxt; | ||
|
||
$robotsTxtContent = file_get_contents('https://www.crwlr.software/robots.txt'); | ||
$robotsTxt = RobotsTxt::parse($robotsTxtContent); | ||
|
||
$robotsTxt->isAllowed('/packages', 'MyBotName'); | ||
``` | ||
## Documentation | ||
You can find the documentation at [crwlr.software](https://www.crwlr.software/packages/robots-txt/getting-started). | ||
|
||
You can also check with an absolute url. | ||
But attention: the library won't (/can't) check if the host of your | ||
absolute url is the same as the robots.txt file was on (because it | ||
doesn't know the host where it's on, you just give it the content). | ||
## Contributing | ||
|
||
```php | ||
$robotsTxt->isAllowed('https://www.crwlr.software/packages', 'MyBotName'); | ||
``` | ||
If you consider contributing something to this package, read the [contribution guide (CONTRIBUTING.md)](CONTRIBUTING.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.