Crates.io | voight_kampff |
lib.rs | voight_kampff |
version | 0.1.2 |
source | src |
created_at | 2020-11-30 01:34:04.019622 |
updated_at | 2020-12-18 07:18:35.480538 |
description | A user agent checker |
homepage | https://github.com/TQTheNeck/voight_kampff-rs |
repository | https://github.com/TQTheNeck/voight_kampff-rs |
max_upload_size | |
id | 318057 |
size | 148,933 |
This crate is a rust version of this excellent ruby gem for figuring out if a http request is from a bot/crawler/scraper/replicant.
It relies only on the user agent that was sent and does no other checks on its own.
voight_kampff::bot()
will return true if the user agent matches a user agent in the crawler-user-agents.json
file
In your Cargo.toml:
voight_kampff = "0.1.2"
In your code:
use voight_kampff;
voight_kampff::bot("Mozilla/5.0 ...");
As with the ruby version, this crate gets its list of user agents from this repo by monperrus.