future_rss

Use Rust to Serialize the Rss structure.

Usage

toml tokio = { version ="*", features = [ "macros","rt-core" ] } future_rss = "*"

Examples

Parse Xml

```rust use future_rss::*;

[tokio::main]

async fn main()->Result<(),Box> { let address = "https://www.zhihu.com/rss"; let mut parser = RssParser::fromurl(address,"utf8").await?; parser.authortag = String::from("dc:creator");

let rss = parser.parse_vec().await?;
println!("{:?}",rss);    
Ok(())

} ```

Parse Web XMl

```rust use future_rss::RssParser;

[tokio::main]

async fn main()->Result<(),Box> { let address = "https://www.zhihu.com/rss"; let mut parser = RssParser::fromurl(address,"utf8").await?; parser.authortag = String::from("dc:creator"); assert!(parser.parsejson().await.isok()); Ok(()) } ```

RSS To Json

```rust use future_rss::RssParser;

[tokio::main]

async fn main()->Result<(),Box> { let address = "https://www.zhihu.com/rss"; let mut parser = RssParser::fromurl(address,"utf8").await?; parser.authortag = String::from("dc:creator"); assert!(parser.parsejson().await.isok()); Ok(()) } ```

Rss Request Builder

```rust use future_rss::RssParser;

[tokio::main]

async fn main()->Result<(),Box> { let address = "https://www.zhihu.com/rss"; let mut parser = RssParser::new(); parser.authortag = "dc:creator".into(); parser.publishtag = "pubDate".into(); let xml = parser.requestxml(address.asstr(),charset.asstr()).await?; parser.setxml(xml); assert!(parser.parsevec().await.isok()); Ok(()) } ```

Advanced

Examples