Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rust-syndication/syndication

Library for serializing Atom and RSS web feeds
https://github.com/rust-syndication/syndication

Last synced: about 2 months ago
JSON representation

Library for serializing Atom and RSS web feeds

Awesome Lists containing this project

README

        

# rust-syndication

[![Cargo Version](https://img.shields.io/crates/v/syndication.svg)](https://crates.io/crates/syndication)
[![Build Status](https://travis-ci.org/rust-syndication/syndication.svg?branch=master)](https://travis-ci.org/rust-syndication/syndication)

Library for serializing Atom and RSS web feeds. Wraps around [rust-atom](https://github.com/rust-syndication/atom) and [rust-rss](https://github.com/rust-syndication/rss).

## Usage

### Reading
```rust
let atom_str = r#"

urn:uuid:b3420f84-6bdf-4f46-a225-f1b9a14703b6
TechCrunch
2019-04-01T07:30:00Z

urn:uuid:4ae8550b-2987-49fa-9f8c-54c180c418ac
Ford hires Elon Musk as CEO
2019-04-01T07:30:00Z

"#;

match atom_str.parse::().unwrap() {
Feed::Atom(atom_feed) => println!("Atom feed first entry: {:?}", atom_feed.entries[0].title),
_ => {}
};

let rss_str = r#"


TechCrunch
http://techcrunch.com
The latest technology news and information on startups

Ford hires Elon Musk as CEO
01 Apr 2019 07:30:00 GMT
In an unprecedented move, Ford hires Elon Musk.

"#;

match rss_str.parse::().unwrap() {
Feed::RSS(rss_feed) => println!("RSS feed first entry: {:?}",
rss_feed.items[0].title),
_ => {}
};
```

### Writing
Currently not supported.

## Todo
- Parse feeds into common format.
- Support writing feeds.

## License

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.