https://github.com/embarkstudios/tame-webpurify
💩 Small HTTP client for the Webpurify API following the sans-io approach 🦀
https://github.com/embarkstudios/tame-webpurify
Last synced: 11 months ago
JSON representation
💩 Small HTTP client for the Webpurify API following the sans-io approach 🦀
- Host: GitHub
- URL: https://github.com/embarkstudios/tame-webpurify
- Owner: EmbarkStudios
- License: apache-2.0
- Created: 2023-04-21T07:30:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-20T10:26:55.000Z (almost 3 years ago)
- Last Synced: 2025-08-10T10:55:05.154Z (11 months ago)
- Language: Rust
- Size: 56.6 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `💩 tame-webpurify`
**Super simple client for the WebPurify REST API**
[](https://embark.dev)
[](https://discord.gg/dAuKfZS)
[](https://crates.io/crates/tame-webpurify)
[](https://docs.rs/tame-webpurify)
[](https://deps.rs/repo/github/EmbarkStudios/tame-webpurify)
[//]: # ([](https://embarkstudios.github.io/presser/presser/index.html))
[//]: # ([](https://github.com/EmbarkStudios/physx-rs/actions))
## What is this?
An incredibly small library to interact with the https://www.webpurify.com/documentation/ REST API.
`tame-webpurify` takes the [sans-io](https://sans-io.readthedocs.io/) approach and builds up the request objects for you so that you can use whatever library you're used to for the actual HTTP transport.
Please be advised that the source code will contain some swearing etc. Can't test a profanity filter / content-moderation API
without actually acting like a jerk.
See the example code on how to use it `tame-webpurify` together with [reqwest](https://crates.io/crates/reqwest)
## Examples
Build and run the provided example:
```bash
$ cargo run --example profanity -- --apikey
=>
{
status: 200,
version: HTTP/2.0,
headers: { ... },
body: {
"rsp": {
"@attributes": {
"stat": "ok",
"rsp": "0.062274932861328"
},
"method": "webpurify.live.replace",
"format": "rest",
"found": "3",
"text": "**** you man! call me at +**********3 or email me at ****.****@*******.***",
"api_key": "some-api-key"
}
}
}
```
## Supported methods
The following WebPurify methods are currently available:
```rust
pub enum Method {
/// webpurify.live.check
Check,
/// webpurify.live.check
Replace(String),
}
```
[//]: # (## TEMPLATE INSTRUCTIONS)
[//]: # ()
[//]: # (1. Create a new repository under EmbarkStudios using this template.)
[//]: # (1. **Title:** Change the first line of this README to the name of your project, and replace the sunflower with an emoji that represents your project. 🚨 Your emoji selection is critical.)
[//]: # (1. **Badges:** In the badges section above, change the repo name in each URL. If you are creating something other than a Rust crate, remove the crates.io and docs badges (and feel free to add more appropriate ones for your language).)
[//]: # (1. **CI:** In `./github/workflows/` rename `rust-ci.yml` (or the appropriate config for your language) to `ci.yml`. And go over it and adapt it to work for your project)
[//]: # ( - If you aren't using or customized the CI workflow, also see the TODO in `.mergify.yml`)
[//]: # ( - If you want to use the automatic rustdoc publishing to github pages for git main, see `rustdoc-pages.yml`)
[//]: # (1. **Issue & PR Templates**: Review the files in `.github/ISSUE_TEMPLATE` and `.github/pull_request_template`. Adapt them)
[//]: # (to suit your needs, removing or re-wording any sections that don't make sense for your use case.)
[//]: # (1. **CHANGELOG.md:** Change the `$REPO_NAME` in the links at the bottom to the name of the repository, and replace the example template lines with the actual notes for the repository/crate.)
[//]: # (1. **release.toml:** in `./release.toml` change the `$REPO_NAME` to the name of the repository)
[//]: # (1. **Cleanup:** Remove this section of the README and any unused files (such as configs for other languages) from the repo.)
## Contributing
[](CODE_OF_CONDUCT.md)
We welcome community contributions to this project.
Please read our [Contributor Guide](CONTRIBUTING.md) for more information on how to get started.
Please also read our [Contributor Terms](CONTRIBUTING.md#contributor-terms) before you make any contributions.
Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:
### License
This contribution is dual licensed under EITHER OF
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )
at your option.
For clarity, "your" refers to Embark or any other licensee/user of the contribution.