1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! News module for Arch Linux news and security advisories.
//!
//! This module provides:
//!
//! - **Arch news** — fetch and parse the official news RSS feed
//! (`https://archlinux.org/feeds/news/`)
//! - **Security advisories** — fetch and parse the advisory Atom feed
//! (`https://security.archlinux.org/advisory/feed.atom`)
//! - **Date normalization** — feed dates (RFC 2822 / RFC 3339 / ISO 8601)
//! normalized to `YYYY-MM-DD` for lexicographic sorting
//!
//! Parse functions are pure (no network), so applications can test against
//! recorded feeds. Fetch functions take a caller-provided `reqwest::Client`,
//! keeping timeouts, user agent, and fetch cadence under caller control.
//!
//! # Features
//!
//! This module requires the `news` feature flag:
//!
//! ```toml
//! [dependencies]
//! arch-toolkit = { version = "0.2", features = ["news"] }
//! ```
//!
//! # Examples
//!
//! ## Fetch Recent News
//!
//! ```no_run
//! use arch_toolkit::news::fetch_arch_news;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let client = reqwest::Client::new();
//! let items = fetch_arch_news(&client, 10, None).await?;
//! for item in items {
//! println!("{} {}", item.date, item.title);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Fetch Security Advisories Since a Date
//!
//! ```no_run
//! use arch_toolkit::news::fetch_security_advisories;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let client = reqwest::Client::new();
//! let advisories = fetch_security_advisories(&client, 50, Some("2026-01-01")).await?;
//! for advisory in advisories {
//! println!("{} [{}] {}", advisory.date, advisory.severity, advisory.title);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Parse a Recorded Feed (no network)
//!
//! ```
//! use arch_toolkit::news::parse_arch_news_rss;
//!
//! let rss = "<item><title>Update</title><link>https://archlinux.org/news/u/</link>\
//! <pubDate>Thu, 21 Aug 2025 12:00:00 +0000</pubDate></item>";
//! let items = parse_arch_news_rss(rss, 10, None);
//! assert_eq!(items[0].date, "2025-08-21");
//! ```
// Re-export types from types module
pub use crate;
// Re-export generic cache boundary
pub use ;
// Re-export news functions
pub use ;
// Re-export article extraction functions
pub use ;
// Re-export advisory functions
pub use ;
// Re-export date utilities
pub use normalize_feed_date;