Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rust-syndication/syndication
Library for serializing Atom and RSS web feeds
https://github.com/rust-syndication/syndication
Last synced: 3 months ago
JSON representation
Library for serializing Atom and RSS web feeds
- Host: GitHub
- URL: https://github.com/rust-syndication/syndication
- Owner: rust-syndication
- License: apache-2.0
- Created: 2015-09-09T21:47:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-22T08:21:17.000Z (about 1 year ago)
- Last Synced: 2024-05-02T12:39:45.435Z (7 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/syndication
- Size: 31.3 KB
- Stars: 39
- Watchers: 2
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
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.