-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the build failure caused by the breaking change in cookie <= 0.…
…18 and changed the README format from .rst to .md (#9) * Change the README format from .rst to .md to provider better crates.io support * Fixed the code for cookie=0.18 * Fixed the README.md
- Loading branch information
1 parent
7e79c08
commit 82367df
Showing
4 changed files
with
74 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
# browsercookie-rs | ||
|
||
A rust crate useful for extracting cookies from browsers. Inspired from [browsercookie](https://pypi.org/project/browsercookie/) python library. | ||
|
||
## Library | ||
|
||
### Usage | ||
|
||
Using the library is quite simple | ||
|
||
```rust | ||
// Cargo.toml | ||
[dependencies] | ||
browsercookie-rs = { git="https://github.com/Ginkooo/browsercookie-rs.git", branch="main" } | ||
``` | ||
|
||
```rust | ||
use browsercookie::{CookieFinder, Browser, Attribute}; | ||
use regex::Regex; | ||
|
||
let mut cookie_jar = CookieFinder::builder() | ||
.with_regexp(Regex::new("google.com").unwrap(), Attribute::Domain) | ||
.with_browser(Browser::Firefox) | ||
.build() | ||
.find() | ||
.await; | ||
|
||
let cookie = cookie_jar.get("some_cookie_name").unwrap(); | ||
|
||
println!("Cookie header string: Cookie: {}", cookie); | ||
``` | ||
|
||
You can omit the `.with_` calls to get all cookies from all browsers. | ||
|
||
A better example should be present in [browsercookies](src/bin.rs). | ||
|
||
## Binary | ||
|
||
The same crate should also give you a binary `browsercookies`, which should be usable from your favorite shell for crudely using frontend APIs for simple tooling. | ||
|
||
```console | ||
browsercookies --domain jira | ||
``` | ||
|
||
## Install | ||
|
||
```console | ||
cargo install -f browsercookie-rs | ||
``` | ||
|
||
## Feature Matrix | ||
|
||
| TargetOS | Firefox | Chrome | | ||
|----------|---------|--------| | ||
| Linux | ✔ | ✗ | | ||
| macOS | ✔ | ✗ | | ||
| Windows | ✗ | ✗ | | ||
|
||
## Contributions | ||
|
||
Contributions are very welcome. The easiest way to contribute is to look at the Python library [browser_cookie3](https://github.com/borisbabic/browser_cookie3), try to mimic the behavior that this library lacks, and submit a pull request. Make sure to format it, use Clippy, and include some tests. |
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