Crate pf_lib

Source
Expand description

§pf_lib

This crate provides functionality to retrieve existing video URLs from a WordPress websites that use the REST API. It supports both media and posts resources.

§Usage

use futures_util::pin_mut;
use futures_util::stream::StreamExt;

#[tokio::main]
async fn main() {
    let config = pf_lib::FinderConfig {
        url: "http://example.com".to_string(),
        ..Default::default()
    };

    let stream = pf_lib::find(&config);

    pin_mut!(stream); // needed for iteration

    while let Some(res) = stream.next().await {
        match res {
            Ok(url) => println!("{}", url),
            Err(e) => eprintln!("{}", e),
        }
    }
}

Structs§

FinderConfig
Configuration for the Finder.

Enums§

FinderTarget
Represents the target type for the Finder.

Functions§

find
Creates an asynchronous stream that fetches video URLs based on the provided configuration.