#parser #feed #start #feed-parser #rss2

feed-parser

A simple RSS/Atom feed parser

13 stable releases

1.0.12 May 6, 2025
1.0.11 Apr 19, 2025
1.0.10 Oct 17, 2024
0.1.0 Oct 9, 2024

#12 in #feed

Download history 8/week @ 2025-02-05 74/week @ 2025-02-12 155/week @ 2025-04-16 17/week @ 2025-04-23 60/week @ 2025-04-30 156/week @ 2025-05-07

388 downloads per month

Apache-2.0

42KB
855 lines

feed-parser

test

This module contains various parsers used in the feed-parser library.

The parsers module provides functionality to parse different types of feed formats, such as RSS and Atom. Each parser is responsible for handling the specific details of its respective feed format, ensuring that the feed data is correctly interpreted and converted into a standardized format for further processing.

Quick Start

use feed_parser::parsers::{Feed, rss2};

let rss_data = r#"
<rss version="2.0">
    <channel>
        <title>RSS Title</title>
        <link>http://www.example.com/main.html</link>
        <description>This is an example of an RSS feed</description>
        <item>
            <title>Item 1</title>
            <link>http://www.example.com/item1.html</link>
            <description>Item 1 description</description>
            <pubDate>2024-01-01T23:59:02Z</pubDate>
        </item>
    </channel>
</rss>
"#;
let feeds: Vec<Feed> = rss2::parse(rss_data).unwrap();
assert_eq!(feeds[0].title, "Item 1");
assert_eq!(feeds[0].link, "http://www.example.com/item1.html");
assert_eq!(feeds[0].description.clone().unwrap(), "Item 1 description");

Modules

  • rss1: Contains the RSS1.0 parser implementation.
  • rss2: Contains the RSS2.0 parser implementation.
  • atom: Contains the Atom parser implementation.

Release Notes

  • v1.0.12
    • Added AppError and AppResult structs.
  • v1.0.11
    • Made it possible to parse HTML in <title></title> and <description></description> sections.

For developers documents

Dependencies

~11–23MB
~320K SLoC

OSZAR »