news-flash 3.1.0

Base library for a modern feed reader
Documentation

news-flash

The core library powering NewsFlash, a modern feed reader for the GNOME desktop. This crate handles feed synchronisation, article management, local storage, and service integration — everything below the UI layer.

Overview

news-flash provides a unified, async Rust API that abstracts over multiple feed service backends. Whether you self-host a FreshRSS instance or subscribe through Feedly, this library normalises the data into a single set of models and persists it in a local SQLite database.

Key capabilities

  • Multi-backend sync — log in, sync, and manage feeds through any supported service with a single FeedApi trait
  • Local RSS/Atom — subscribe directly to feeds without any external service
  • Offline mode — queue read/star/tag actions while offline and replay them on reconnect
  • OPML import & export
  • Favicon discovery — automatic favicon scraping and caching
  • Article scraping — optional full-text extraction via article_scraper (feature-gated)
  • Image downloading — optional offline image caching for articles (feature-gated)
  • Thumbnail extraction — download and cache article thumbnail images

Supported backends

Service API crate Notes
Local RSS/Atom Built-in, no account required
Feedbin feedbin_api
Feedly feedly_api only available if API secrets are provided in the build process
Fever fever_api Compatible with Fever-compatible services
FreshRSS greader_api Via Google Reader API
Inoreader greader_api Via Google Reader API
Miniflux miniflux_api
NewsBlur newsblur_api_updated
Nextcloud News nextcloud_news_api
Commafeed commafeed_api

Cargo Features

Cargo feature Default Description
article-scraper Full-text article extraction using readability-style content scraping
image-downloader Download and cache article images for offline reading

Usage

Add the dependency to your Cargo.toml:

[dependencies]
news-flash = "3.0"

Basic example

use news_flash::{NewsFlash, models::LoginData};

// List available backends
let backends = NewsFlash::list_backends();

// Build an instance
let nf = NewsFlash::builder()
    .plugin(plugin_id)
    .config_dir("/path/to/config")
    .data_dir("/path/to/data")
    .create()?;

// Or restore from a previously configured session
let nf = NewsFlash::builder()
    .config_dir("/path/to/config")
    .data_dir("/path/to/data")
    .try_load()?;

Adding a new backend

A detailed guide lives in docs/integrate_new_service.md. The short version:

  1. Create (or find) a standalone API crate for the service
  2. Copy src/feed_api_implementations/template/ and implement ApiMetadata + FeedApi
  3. Register the new backend in src/feed_api_implementations/mod.rs
  4. Add tests