https://github.com/benmcavoy/raysors
An API helper for Rayso
https://github.com/benmcavoy/raysors
rayso rust webdriver
Last synced: over 1 year ago
JSON representation
An API helper for Rayso
- Host: GitHub
- URL: https://github.com/benmcavoy/raysors
- Owner: BenMcAvoy
- License: mit
- Created: 2024-03-08T20:22:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T10:59:51.000Z (about 2 years ago)
- Last Synced: 2025-02-11T23:45:36.801Z (over 1 year ago)
- Topics: rayso, rust, webdriver
- Language: Rust
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RaysoRS
## Dependencies:
- [GeckoDriver (external)](https://github.com/mozilla/geckodriver)
- [ThirtyFour (crate)](https://crates.io/crates/thirtyfour)
- [Tokio (crate)](https://crates.io/crates/tokio)
- [Base64 (crate)](https://crates.io/crates/base64)
- [URL encoding (crate)](https://crates.io/crates/urlencoding)
## Usage
Make sure you are running `geckodriver` in the background if you are doing downloads as this project uses the geckodriver webdriver.
You can use the library as follows:
```rust
use rayso_rs::{downloader, RaysoConfig};
const CODE: &str = r#"fn main() {
println!("Hello, world!");
}"#;
#[tokio::main]
async fn main() -> Result<(), Box> {
let config = RaysoConfig::builder()
.background(false)
.padding(8)
.code(CODE)
.build();
println!("Generated URL: {}", config.to_url());
downloader::download(config).await?;
Ok(())
}
```
Note: the `downloader::download(config)`... is the only part that requires geckodriver to be running in the background.