24 releases

0.3.6 Oct 11, 2024
0.3.2 Sep 29, 2024
0.2.0 Jul 29, 2024
0.1.14 Jan 18, 2024
0.1.5 Nov 26, 2022

#720 in Command line utilities

Download history 68/week @ 2024-07-23 73/week @ 2024-07-30 292/week @ 2024-08-06 138/week @ 2024-08-13 46/week @ 2024-09-10 22/week @ 2024-09-17 491/week @ 2024-09-24 172/week @ 2024-10-01 673/week @ 2024-10-08 35/week @ 2024-10-15 1/week @ 2024-11-05

61 downloads per month

BlueOak-1.0.0

40KB
768 lines


openring-rs

A tool for generating a webring from Atom/RSS feeds.


openring-rs is a tool for generating a webring from Atom/RSS feeds, so you can populate a template with articles from those feeds and embed them in your own blog. An example template is provided in in.html.

This is a rust-port of Drew DeVault's openring, with the primary differences being:

  • we respect throttling and send conditional requests when using --cache (recommended!)
  • the template is written using Tera and is provided as an argument, not read from stdin
  • we show a little progress bar
  • we fetch all feeds concurrently
  • we provide better error messages (via miette)
  • we allow filtering feeds with --before

Demo

To see this in action, you can look at the footer of this blog post.

https://luke.hsiao.dev/blog/openring-rs/

Install

cargo install --locked openring

Usage

A webring for static site generators written in Rust

Usage: openring [OPTIONS] --template-file <FILE>

Options:
  -n, --num-articles <NUM_ARTICLES>    Total number of articles to fetch [default: 3]
  -p, --per-source <PER_SOURCE>        Number of most recent articles to get from each feed [default: 1]
  -S, --url-file <FILE>                File with URLs of Atom/RSS feeds to read (one URL per line, lines starting with '#' or "//" are ignored)
  -t, --template-file <FILE>           Tera template file
  -s, --url <URL>                      A single URL to consider (can be repeated to specify multiple)
  -b, --before <BEFORE>                Only include articles before this date (in YYYY-MM-DD format)
  -c, --cache                          Use request cache stored on disk at `.openringcache`
      --max-cache-age <MAX_CACHE_AGE>  Discard all cached requests older than this duration [default: 14d]
  -v, --verbose...                     Increase logging verbosity
  -q, --quiet...                       Decrease logging verbosity
  -h, --help                           Print help (see more with '--help')
  -V, --version                        Print version

Using Tera Templates

The templates supported by openring-rs are written using Tera. Please refer to the Tera documentation for details.

Why a Rust Port?

Just for fun.

Dependencies

~32–50MB
~870K SLoC