rust-syndication / atom

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
Library for serializing the Atom web content syndication format https://crates.io/crates/atom_syndication

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to atom

Atoma
Atom, RSS and JSON feed parser for Python 3
Stars: ✭ 67 (-1.47%)
Mutual labels:  atom, feed
Gofeed
Parse RSS, Atom and JSON feeds in Go
Stars: ✭ 1,762 (+2491.18%)
Mutual labels:  atom, feed
Discord feedbot
Moved to https://gitlab.com/ffreiheit/discord_feedbot
Stars: ✭ 67 (-1.47%)
Mutual labels:  atom, feed
Miniflux Legacy
Minimalist RSS reader (version 1.x)
Stars: ✭ 897 (+1219.12%)
Mutual labels:  atom, feed
Feed Module
Everyone deserves RSS, ATOM and JSON feeds!
Stars: ✭ 182 (+167.65%)
Mutual labels:  atom, feed
Hfeed2atom
Python functions to convert a h-feed to Atom 1.0
Stars: ✭ 11 (-83.82%)
Mutual labels:  atom, feed
Rss Atom Bundle
RSS and Atom Bundle for Symfony
Stars: ✭ 123 (+80.88%)
Mutual labels:  atom, feed
Jquery Rss
An easy-to-use rss plugin for jquery with templating.
Stars: ✭ 443 (+551.47%)
Mutual labels:  atom, feed
Pluto
pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds
Stars: ✭ 174 (+155.88%)
Mutual labels:  atom, feed
Posidonlauncher
a one-page homescreen with a news feed
Stars: ✭ 163 (+139.71%)
Mutual labels:  atom, feed
Liferea
Liferea (Linux Feed Reader), a news reader for GTK/GNOME
Stars: ✭ 612 (+800%)
Mutual labels:  atom, feed
Feed Io
A PHP library to read and write feeds in JSONFeed, RSS or Atom format
Stars: ✭ 200 (+194.12%)
Mutual labels:  atom, feed
Feed
A RSS, Atom and JSON Feed generator for Node.js, making content syndication simple and intuitive! 🚀
Stars: ✭ 523 (+669.12%)
Mutual labels:  atom, feed
Youtube Fetcher
📺 Youtube Podcasting 🎧
Stars: ✭ 31 (-54.41%)
Mutual labels:  atom, feed
Python Feedgen
Python module to generate ATOM feeds, RSS feeds and Podcasts.
Stars: ✭ 501 (+636.76%)
Mutual labels:  atom, feed
Feedbag
Ruby's favorite feed auto-discovery library/tool
Stars: ✭ 115 (+69.12%)
Mutual labels:  atom, feed
Hexo Generator Feed
Feed generator for Hexo.
Stars: ✭ 400 (+488.24%)
Mutual labels:  atom, feed
Picofeed
PHP library to parse and write RSS/Atom feeds
Stars: ✭ 439 (+545.59%)
Mutual labels:  atom, feed
Feedparser
feedparser gem - (universal) web feed parser and normalizer (XML w/ Atom or RSS, JSON Feed, HTML w/ Microformats e.g. h-entry/h-feed or Feed.HTML, Feed.TXT w/ YAML, JSON or INI & Markdown, etc.)
Stars: ✭ 156 (+129.41%)
Mutual labels:  atom, feed
Event Driven Spring Boot
Example Application to demo various flavours of handling domain events in Spring Boot
Stars: ✭ 194 (+185.29%)
Mutual labels:  atom, feed

atom

Build status Crates.io Status Coverage

Library for serializing the Atom web content syndication format.

Documentation

This crate requires Rustc version 1.56.0 or greater.

Usage

Add the dependency to your Cargo.toml.

[dependencies]
atom_syndication = "0.11"

Or, if you want Serde include the feature like this:

[dependencies]
atom_syndication = { version = "0.11", features = ["with-serde"] }

The package includes a single crate named atom_syndication.

extern crate atom_syndication;

Reading

A feed can be read from any object that implements the BufRead trait or using the FromStr trait.

use std::fs::File;
use std::io::BufReader;
use atom_syndication::Feed;

let file = File::open("example.xml").unwrap();
let feed = Feed::read_from(BufReader::new(file)).unwrap();

let string = "<feed></feed>";
let feed = string.parse::<Feed>().unwrap();

Writing

A feed can be written to any object that implements the Write trait or converted to an XML string using the ToString trait.

Note: Writing a feed does not perform any escaping of XML entities.

Example

use std::fs::File;
use std::io::{BufReader, sink};
use atom_syndication::Feed;

let file = File::open("example.xml").unwrap();
let feed = Feed::read_from(BufReader::new(file)).unwrap();

// write to the feed to a writer
feed.write_to(sink()).unwrap();

// convert the feed to a string
let string = feed.to_string();

Invalid Feeds

As a best effort to parse invalid feeds atom_syndication will default elements declared as "required" by the Atom specification to an empty string.

License

Licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].