• Stars
    star
    192
  • Rank 202,019 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate RSS feeds from websites


RSS Please

A small tool (rsspls) to generate RSS feeds from web pages that lack them. It runs on BSD, Linux, macOS, Windows, and more.


rsspls generates RSS feeds from web pages. Example use cases:

  • Create a feed for a blog that does not have one so that you will know when there are new posts.
  • Create a feed from the search results on real estate agent's website so that you know when there are new listingsโ€”without having to check manually all the time.
  • Create a feed of the upcoming tour dates of your favourite band or DJ.
  • Create a feed of the product page for a company, so you know when new products are added.

The idea is that you will then subscribe to the generated feeds in your feed reader. This will typically require the feeds to be hosted via a web server.

Contents

Install

rsspls can be installed via one of the following methods:

Package Manager

rsspls is packaged in these package managers:

  • AUR
  • Homebrew: brew install wezm/taps/rsspls

Pre-compiled Binary

Pre-compiled binaries are available for a number of platforms. They require no additional dependencies on your computer.

Example to download and extract a binary:

curl https://releases.wezm.net/rsspls/0.6.1/rsspls-0.6.1-x86_64-unknown-linux-musl.tar.gz | tar zxf -

This will result in the rsspls binary in the current directory.

Usage

Configuration

Unless specified via the --config command line option rsspls reads its configuration from one of the following paths:

  • UNIX-like systems:
    • $XDG_CONFIG_HOME/rsspls/feeds.toml
    • ~/.config/rsspls/feeds.toml if XDG_CONFIG_HOME is unset.
  • Windows:
    • C:\Users\You\AppData\Roaming\rsspls\feeds.toml

The configuration file is in TOML format.

The parts of the page to extract for the feed are specified using CSS selectors.

Annotated Sample Configuration

The sample file below demonstrates all the parts of the configuration.

# The configuration must start with the [rsspls] section
[rsspls]
# Optional output directory to write the feeds to. If not specified it must be supplied via
# the --output command line option.
output = "/tmp"

# Next is the array of feeds, each one starts with [[feed]]
[[feed]]
# The title of the channel in the feed
title = "My Great RSS Feed"
# The output filename without the output directory to write this feed to.
# Note: this is a filename only, not a path. It should not contain slashes.
filename = "wezm.rss"

# The configuration for the feed
[feed.config]
# The URL of the web page to generate the feed from.
url = "https://www.wezm.net/"
# A CSS selector to select elements on the page that represent items in the feed.
item = "article"
# A CSS selector relative to `item` to an element that will supply the title for the item.
heading = "h3"
# A CSS selector relative to `item` to an element that will supply the link for the item.
# Note: This element must have a `href` attribute.
# Note: If not supplied rsspls will attempt to use the heading selector for link for backwards
#       compatibility with earlier versions. A message will be emitted in this case.
link = "h3 a"
# Optional CSS selector relative to `item` that will supply the content of the RSS item.
summary = ".post-body"
# Optional CSS selector relative to `item` that supples the publication date of the RSS item.
date = "time"
# Alternatively for more control `date` can be specified as a table:
# [feed.config.date]
# selector = "time"
# # Optional type of value being parsed.
# # Defaults to DateTime, can also be Date if you're parsing a value without a time.
# type = "Date" 
# # format of the date to parse. See the following for the syntax
# # https://time-rs.github.io/book/api/format-description.html
# format = "[day padding:none]/[month padding:none]/[year]" # will parse 1/2/1934 style dates

# A second example feed
[[feed]]
title = "Example Site"
filename = "example.rss"

[feed.config]
url = "https://example.com/"
item = "div"
heading = "a"

The first example above (for my blog WezM.net) matches HTML that looks like this:

<section class="posts-section">
  <h2>Recent Posts</h2>

  <article id="garage-door-monitor">
    <h3><a href="https://www.wezm.net/v2/posts/2022/garage-door-monitor/">Monitoring My Garage Door With a Raspberry Pi, Rust, and a 13Mb Linux System</a></h3>
    <div class="post-metadata">
      <div class="date-published">
        <time datetime="2022-04-20T06:38:27+10:00">20 April 2022</time>
      </div>
    </div>

    <div class="post-body">
      <p>Iโ€™ve accidentally left our garage door open a few times. To combat this I built
        a monitor that sends an alert via Mattermost when the door has been left open
        for more than 5 minutes. This turned out to be a super fun project. I used
        parts on hand as much as possible, implemented the monitoring application in
        Rust, and then built a stripped down Linux image to run it.
      </p>
    </div>

    <a href="https://www.wezm.net/v2/posts/2022/garage-door-monitor/">Continue Reading โ†’</a>
  </article>

  <article id="monospace-kobo-ereader">
    <!-- another article -->
  </article>

  <!-- more articles -->

  <a href="https://www.wezm.net/v2/posts/">View more posts โ†’</a>
</section>

More Detail on Date Handling

The date key in the configuration can be a string or a table. If it's a string then it's used as selector to find the element containing the date and rsspls will attempt to automatically parse the value. If automatic parsing fails you can manually specify the format using the table form of date:

[feed.config.date]
selector = "time" # required
type = "Date"
format = "[day padding:none]/[month padding:none]/[year]"

If the element matched by the date selector is a <time> element then rsspls will first try to parse the value in the datetime attribute if present. If the attribute is missing or the element is not a time element then rsspls will use the supplied format or attempt automatic parsing of the text content of the element.

Hosting

It is expected that rsspls will be run on a web server that is serving the directory the feeds are written to. rsspls just generates the feeds, it's not a server. In order to have the feeds update you will need to arrange for rsspls to be run periodically. You might do this with cron, systemd timers, or the Windows equivalent.

Caveats

rsspls just fetches and parses the HTML of the web page you specify. It does not run JavaScript. If the website is entirely generated by JavaScript (such as Twitter) then rsspls will not work.

Caching

When websites respond with cache headers rsspls will make a conditional request on subsequent runs and will not regenerate the feed if the server responds with 304 Not Modified. Cache data is stored in $XDG_CACHE_HOME/rsspls, which defaults to ~/.cache/rsspls on UNIX-like systems or C:\Users\You\AppData\Local\rsspls on Windows.

Build From Source

Minimum Supported Rust Version: 1.63.0

rsspls is implemented in Rust. See the Rust website for instructions on installing the toolchain.

From Git Checkout or Release Tarball

Build the binary with cargo build --release --locked. The binary will be in target/release/rsspls.

From crates.io

cargo install rsspls

Credits

Licence

This project is dual licenced under either of:

at your option.

More Repositories

1

RegexKitLite

Git mirror of RegexKitLite SVN repo
Objective-C
616
star
2

read-rust

Read Rust allows you to keep up with articles about the Rust programming language.
Crystal
192
star
3

titlecase

A tool and Rust crate for transforming text into Title Case.
Rust
80
star
4

git-grab

Clone a git repository into a standard location organised by domain and path.
Rust
74
star
5

linux-conf-au-2019-epaper-badge

My IoT badge for lca2019
Rust
63
star
6

ssd1675

Rust driver for SSD1675 e-Paper display controller
Rust
57
star
7

leaf

Lightweight, self-hosted task tracking
Rust
48
star
8

pkb

Personal knowledge base
Rust
47
star
9

profont

ProFont for the embedded-graphics crate
Rust
45
star
10

node-genx

node.js binding to the Genx XML generation library
C++
25
star
11

dotfiles

My CLI configuration files
Vim Script
25
star
12

kyoto-client

node.js module that acts as a client to a Kyoto Tycoon server
CoffeeScript
23
star
13

garage-door-monitor

Rust
19
star
14

bar

A bar that lives in the awesome window manager wibar
Rust
12
star
15

desktop.institute

Researching a better desktop environment
HTML
11
star
16

clueboard-rust-firmware

A firmware for the Clueboard 66% Low Profile keyboard implemented in Rust.
Rust
10
star
17

simplistic-notes

A Simplenote API server to aid testing
Ruby
9
star
18

feedfinder

Rust crate for auto-discovery of feeds in HTML content
Rust
7
star
19

open2300

Open2300 is a package of software tools that reads (and writes) data from a Lacrosse WS23xx Weather Stations. This repo is an import of the official SVN repo with some additions.
C
7
star
20

OCMustache

{{ mustache }} for Objective-C
Objective-C
7
star
21

frond

Lightweight, self-hosted Markdown notes
Crystal
6
star
22

WallFlower

A wall appliance
6
star
23

dns

My DNS records
Lua
6
star
24

steno-lookup

Tool to look up stenography strokes for a given word
Rust
6
star
25

wezm.net

Source of my website
HTML
6
star
26

pitemp

Small tool to display CPU and GPU temperature on Raspberry Pi
Rust
5
star
27

mistakes.computer

A silly project to try out Deno Deploy.
TypeScript
5
star
28

aur

My PKGBUILDs
Shell
5
star
29

xhtmlchardet

Encoding detection for XML and HTML in Rust
Rust
5
star
30

timestampr

Tool for writing timestamps to a file to make video editing easier
Rust
5
star
31

7clock

A terminal clock that uses 7-segment display characters
Rust
5
star
32

github-system-emoji-extension

Firefox extension for Linux to make GitHub use system emoji instead of ugly images of Noto Color Emoji
JavaScript
5
star
33

macbinary

MacBinary and resource fork reading in Rust
Rust
5
star
34

objc-cairo

Objective-C bindings for Cairo
Objective-C
4
star
35

Password-Composer

Password generator app for Mac OS X
Objective-C
4
star
36

dewpoint.7bit.org

Rust
4
star
37

evolve-image

Evolve an image using polygons with cross platform Objective-C
Objective-C
4
star
38

dash2alfred

Convert between Dash, Alfred 3 and Xpander snippets
Ruby
4
star
39

ferris-weather

A demo app to try building a networked Rust application for PPC classic Mac OS
Rust
4
star
40

classic-mac-rust

Experiments using Rust code in classic Mac applications
Rust
3
star
41

rsdate

rsdate connects to an ntp server, printing the returned time and/or sets the system clock.
Rust
3
star
42

advent-of-code

My advent of code solutions
Rust
3
star
43

emoji-list

Rust crate with a list of all emoji
Rust
3
star
44

c2rust-dwm

A functional conversion of the dwm window manager to Rust via C2Rust (generated code is not idomatic Rust)
Rust
3
star
45

MindGame

Simple tile game
Objective-C
3
star
46

distros2dot

Generate a graph of operating system derivation
Ruby
3
star
47

dash2html

Tool to create a HTML page of your Dash snippets
Rust
3
star
48

hashmap-vs-vec

Some Rust benchmarks of looking up a mapping between two numbers
Rust
2
star
49

classic-mac-nim

Experiments using Nim to build classic Mac applications
Nim
2
star
50

tmk_firmware

TMK based firmwares for my keyboards
C
2
star
51

upload-to-s3

Small tool to upload a file to Amazon S3
Rust
2
star
52

monothumb

Creates an image sprite from recent Flickr uploads with monochrome and colour versions of each thumbnail
Objective-C
2
star
53

rust-mattermost-driver

WIP Mattermost API client
Rust
2
star
54

allocator

Tool to calculate budget allocations for MoneyWell
Ruby
2
star
55

cc2650

Embedded Rust access API for TI SimpleLink CC2650 MCU
Rust
2
star
56

wasmtime-plugin

Rust
2
star
57

weather-tools

Tools to generate weather stats from weather DB
Lua
2
star
58

scrftch

Screenfetch in Rust
Rust
1
star
59

bluez-api-parser

Gem and tool for generating D-Bus introspection XML from the BlueZ API documentation
Ruby
1
star
60

Gare-du-Nord

A toy app to play with grand central dispatch
Objective-C
1
star
61

Foundry

Personal Publishing Platform written in Scala with Lift
JavaScript
1
star
62

cc26x0-hal

Embedded Rust HAL for TI SimpleLink CC26x0 MCUs
1
star
63

Quotes

A small web app for quoting friends.
Rust
1
star
64

gps-monitor

Small program that reads NMEA sentences from a serial port and prints out the parsed results.
Rust
1
star
65

libstriptags

Little library to strip HTML tags
Rust
1
star
66

pretzboard

Rust
1
star
67

babushka-deps

Ruby
1
star
68

standup-picker

Rust
1
star
69

wizards-bot

A helpful Mattermost bot for a small community.
Rust
1
star
70

pass2csv

Tool to export data from pass for import into another password manager.
Rust
1
star
71

connect-kyoto

Kyoto Tycoon backed session store for Connect
CoffeeScript
1
star
72

timetable-tools

Tools for working with V/Line timetable PDFs (Incomplete)
Ruby
1
star
73

PhotoGrid

Generate a calender of photos
JavaScript
1
star
74

DirectoryEnumerator

iOS project that reproduces NSDirectoryEnumerator problem
Objective-C
1
star
75

ergo

A self hosted url shortener written in Go
1
star
76

bluez-introspection-xml

D-Bus introspection XML generated from the BlueZ API documentation
1
star
77

rsss

Really Simple Sync Server โ€“ A sync server for RSS feeds
C
1
star
78

tcl

Tcl inspired command language for embbedding in Rust
Rust
1
star
79

expand-t-co

Expand t.co links in supplied text
Rust
1
star
80

lightword

My customisations to the lightword Wordpress theme
JavaScript
1
star
81

svg-dump

Extract SVGs from SVGinOT fonts
Rust
1
star
82

7bit.org

Content at the root of 7bit.org
JavaScript
1
star