ua_generator

Crates.ioua_generator
lib.rsua_generator
version0.5.0
sourcesrc
created_at2022-06-08 20:39:54.921236
updated_at2024-07-14 18:54:44.208874
descriptionRandom User Agent Spoofer in Rust.
homepage
repositoryhttps://github.com/a11ywatch/ua_generator
max_upload_size
id602249
size18,565
Jeff Mendez (j-mendez)

documentation

https://docs.rs/ua_generator

README

ua_generator

Generate random real User-Agents to use as spoofs.

How to use

Example of generating a randomized user agent updated weekly.

cargo add ua_generator --git https://github.com/spider-rs/ua_generator.git
use ua_generator::ua::spoof_ua;

fn main() {
    let ua = spoof_ua();

    println!("{}", ua);
    // Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
};

The static files are checked and generated from the build.rs file to prevent extra need for API calls since they are limited and require authentication.

If you plan on using this building locally you need a valid API key from the Spider Cloud API and set the value to the env var APILAYER_KEY. You can run BUILD_ENABLED=1 APILAYER_KEY=$APILAYER_KEY cargo build to generate the static files. You can also change the API endpoint using the env variable API_URL.

Commit count: 176

cargo fmt