-
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.
- Loading branch information
1 parent
5e76ea5
commit a952b05
Showing
4 changed files
with
54 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# robots | ||
|
||
[![Build Status](https://github.com/AntoineGagne/robots/actions/workflows/erlang.yml/badge.svg)](https://github.com/AntoineGagne/robots/actions) | ||
[![Hex Pm](http://img.shields.io/hexpm/v/robots.svg?style=flat)](https://hex.pm/packages/robots) | ||
[![Docs](https://img.shields.io/badge/hex-docs-green.svg?style=flat)](https://hexdocs.pm/robots) | ||
[![Releases](https://img.shields.io/github/release/AntoineGagne/robots?color=brightgreen)](https://github.com/AntoineGagne/robots/releases) | ||
[![Coverage](https://coveralls.io/repos/github/AntoineGagne/robots/badge.svg?branch=master)](https://coveralls.io/github/AntoineGagne/robots?branch=master) | ||
|
||
A library that parses and validates rules from `robots.txt`. | ||
|
||
## Installation | ||
|
||
This library is available on [hex.pm](https://hex.pm/packages/robots). | ||
To install this library, simply add the following lines to your | ||
`rebar.config`: | ||
|
||
```erlang | ||
{robots, "1.1.1"} | ||
``` | ||
|
||
## Usage | ||
|
||
```erlang | ||
Content = <<"User-Agent: bot\nAllow: /fish">>, | ||
%% This will return an opaque type that contains all the rules and their agents | ||
{ok, RulesIndex} = robots:parse(Content, 200), | ||
true = robots:is_allowed(<<"bot/1.0.0">>, <<"/fish/salmon.html">>, RulesIndex), | ||
true = robots:is_allowed(<<"bot/1.0.0">>, <<"/Fish.asp">>, RulesIndex), | ||
``` | ||
|
||
## Development | ||
|
||
### Running all the tests and linters | ||
|
||
You can run all the tests and linters with the `rebar3` alias: | ||
|
||
```sh | ||
rebar3 check | ||
``` |
This file was deleted.
Oops, something went wrong.
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