|
4 | 4 | </h1>
|
5 | 5 |
|
6 | 6 | <div align="center">
|
7 |
| - <strong>A small tool (<code>rsspls</code>) to generate RSS feeds from web pages that lack them. |
8 |
| - It runs on BSD, Linux, macOS, Windows, and more.</strong> |
| 7 | + <strong>A small tool (<code>rsspls</code>) to generate RSS feeds from web |
| 8 | + pages that lack them. It runs on BSD, Linux, macOS, Windows, and |
| 9 | + more.</strong> |
9 | 10 | </div>
|
10 | 11 |
|
11 | 12 | <br>
|
|
35 | 36 | The idea is that you will then subscribe to the generated feeds in your feed
|
36 | 37 | reader. This will typically require the feeds to be hosted via a web server.
|
37 | 38 |
|
38 |
| -Contents |
39 |
| --------- |
| 39 | +For more information including installation instructions, documentation, and |
| 40 | +news visit the [RSS Please website][website]. |
40 | 41 |
|
41 |
| -- [Contents](#contents) |
42 |
| -- [Install](#install) |
43 |
| - - [Package Manager](#package-manager) |
44 |
| - - [Pre-compiled Binary](#pre-compiled-binary) |
45 |
| -- [Usage](#usage) |
46 |
| - - [Configuration](#configuration) |
47 |
| - - [Annotated Sample Configuration](#annotated-sample-configuration) |
48 |
| - - [More Detail on Date Handling](#more-detail-on-date-handling) |
49 |
| - - [Hosting](#hosting) |
50 |
| - - [Caveats](#caveats) |
51 |
| - - [Caching](#caching) |
52 |
| -- [Build From Source](#build-from-source) |
53 |
| - - [From Git Checkout or Release Tarball](#from-git-checkout-or-release-tarball) |
54 |
| - - [From crates.io](#from-cratesio) |
55 |
| -- [Credits](#credits) |
56 |
| -- [Licence](#licence) |
57 |
| - |
58 |
| -Install |
59 |
| -------- |
60 |
| - |
61 |
| -`rsspls` can be installed via one of the following methods: |
62 |
| - |
63 |
| -* [Package Manager](#package-manager) |
64 |
| -* [Pre-compiled Binary](#pre-compiled-binary) |
65 |
| -* [Build From Source](#build-from-source) |
66 |
| - |
67 |
| -### Package Manager |
68 |
| - |
69 |
| -`rsspls` is packaged in these package managers: |
70 |
| - |
71 |
| -* AUR: [rsspls](https://aur.archlinux.org/packages/rsspls) |
72 |
| -* Homebrew: `brew install wezm/taps/rsspls` |
73 |
| -* MacPorts: [rsspls](https://ports.macports.org/port/rsspls/summary/) |
74 |
| - |
75 |
| -### Pre-compiled Binary |
76 |
| - |
77 |
| -Pre-compiled binaries are available for a number of platforms. |
78 |
| -They require no additional dependencies on your computer. |
79 |
| - |
80 |
| -* [FreeBSD 13 amd64](https://releases.wezm.net/rsspls/0.8.1/rsspls-0.8.1-amd64-unknown-freebsd.tar.gz) |
81 |
| -* [Linux x86\_64](https://releases.wezm.net/rsspls/0.8.1/rsspls-0.8.1-x86_64-unknown-linux-musl.tar.gz) |
82 |
| -* [MacOS Universal](https://releases.wezm.net/rsspls/0.8.1/rsspls-0.8.1-universal-apple-darwin.tar.gz) |
83 |
| -* [Windows x86\_64](https://releases.wezm.net/rsspls/0.8.1/rsspls-0.8.1-x86_64-pc-windows-msvc.zip) |
84 |
| - |
85 |
| -Example to download and extract a binary: |
86 |
| - |
87 |
| - curl https://releases.wezm.net/rsspls/0.7.1/rsspls-0.7.1-x86_64-unknown-linux-musl.tar.gz | tar zxf - |
88 |
| - |
89 |
| -This will result in the `rsspls` binary in the current directory. |
90 |
| - |
91 |
| -Usage |
92 |
| ------ |
93 |
| - |
94 |
| -### Configuration |
95 |
| - |
96 |
| -Unless specified via the `--config` command line option `rsspls` reads its |
97 |
| -configuration from one of the following paths: |
98 |
| - |
99 |
| -* UNIX-like systems: |
100 |
| - * `$XDG_CONFIG_HOME/rsspls/feeds.toml` |
101 |
| - * `~/.config/rsspls/feeds.toml` if `XDG_CONFIG_HOME` is unset. |
102 |
| -* Windows: |
103 |
| - * `C:\Users\You\AppData\Roaming\rsspls\feeds.toml` |
104 |
| - |
105 |
| -The configuration file is in [TOML][toml] format. |
106 |
| - |
107 |
| -The parts of the page to extract for the feed are specified using [CSS |
108 |
| -selectors][selectors]. |
109 |
| - |
110 |
| -#### Annotated Sample Configuration |
111 |
| - |
112 |
| -The sample file below demonstrates all the parts of the configuration. |
113 |
| - |
114 |
| -```toml |
115 |
| -# The configuration must start with the [rsspls] section |
116 |
| -[rsspls] |
117 |
| -# Optional output directory to write the feeds to. If not specified it must be supplied via |
118 |
| -# the --output command line option. |
119 |
| -output = "/tmp" |
120 |
| -# Optional proxy address. If specified, all requests will be routed through it. |
121 |
| -# The address needs to be in the format: protocol://ip_address:port |
122 |
| -# The supported protocols are: http, https, socks and socks5h. |
123 |
| -# It can also be specified as environment variable `http_proxy` or `HTTPS_PROXY`. |
124 |
| -# The config file takes precedence, then the env vars in the above order. |
125 |
| -# proxy = socks5://10.64.0.1:1080 |
126 |
| - |
127 |
| -# Next is the array of feeds, each one starts with [[feed]] |
128 |
| -[[feed]] |
129 |
| -# The title of the channel in the feed |
130 |
| -title = "My Great RSS Feed" |
131 |
| - |
132 |
| -# The output filename without the output directory to write this feed to. |
133 |
| -# Note: this is a filename only, not a path. It should not contain slashes. |
134 |
| -filename = "wezm.rss" |
135 |
| - |
136 |
| -# Optional User-Agent header to be set for the HTTP request. |
137 |
| -# user_agent = "Mozilla/5.0" |
138 |
| - |
139 |
| -# The configuration for the feed |
140 |
| -[feed.config] |
141 |
| -# The URL of the web page to generate the feed from. |
142 |
| -url = "https://www.wezm.net/" |
143 |
| - |
144 |
| -# A CSS selector to select elements on the page that represent items in the feed. |
145 |
| -item = "article" |
146 |
| - |
147 |
| -# A CSS selector relative to `item` to an element that will supply the title for the item. |
148 |
| -heading = "h3" |
149 |
| - |
150 |
| -# A CSS selector relative to `item` to an element that will supply the link for the item. |
151 |
| -# Note: This element must have a `href` attribute. |
152 |
| -# Note: If not supplied rsspls will attempt to use the heading selector for link for backwards |
153 |
| -# compatibility with earlier versions. A message will be emitted in this case. |
154 |
| -link = "h3 a" |
155 |
| - |
156 |
| -# Optional CSS selector relative to `item` that will supply the content of the RSS item. |
157 |
| -summary = ".post-body" |
158 |
| - |
159 |
| -# Optional CSS selector relative to `item` that supplies media content (audio, video, image) |
160 |
| -# to be added as an RSS enclosure. |
161 |
| -# Note: The media URL must be given by the `src` or `href` attribute of the selected element. |
162 |
| -# Note: Currently if the item does not match the media selector then it will be skipped. |
163 |
| -# media = "figure img" |
164 |
| - |
165 |
| -# Optional CSS selector relative to `item` that supples the publication date of the RSS item. |
166 |
| -date = "time" |
167 |
| - |
168 |
| -# Alternatively for more control `date` can be specified as a table: |
169 |
| -# [feed.config.date] |
170 |
| -# selector = "time" |
171 |
| -# # Optional type of value being parsed. |
172 |
| -# # Defaults to DateTime, can also be Date if you're parsing a value without a time. |
173 |
| -# type = "Date" |
174 |
| -# # format of the date to parse. See the following for the syntax |
175 |
| -# # https://time-rs.github.io/book/api/format-description.html |
176 |
| -# format = "[day padding:none]/[month padding:none]/[year]" # will parse 1/2/1934 style dates |
177 |
| - |
178 |
| -# A second example feed |
179 |
| -[[feed]] |
180 |
| -title = "Example Site" |
181 |
| -filename = "example.rss" |
182 |
| - |
183 |
| -[feed.config] |
184 |
| -url = "https://example.com/" |
185 |
| -item = "div" |
186 |
| -heading = "a" |
187 |
| -``` |
188 |
| - |
189 |
| -The first example above (for my blog WezM.net) matches HTML that looks like this: |
190 |
| - |
191 |
| -```html |
192 |
| -<section class="posts-section"> |
193 |
| - <h2>Recent Posts</h2> |
194 |
| - |
195 |
| - <article id="garage-door-monitor"> |
196 |
| - <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> |
197 |
| - <div class="post-metadata"> |
198 |
| - <div class="date-published"> |
199 |
| - <time datetime="2022-04-20T06:38:27+10:00">20 April 2022</time> |
200 |
| - </div> |
201 |
| - </div> |
202 |
| - |
203 |
| - <div class="post-body"> |
204 |
| - <p>I’ve accidentally left our garage door open a few times. To combat this I built |
205 |
| - a monitor that sends an alert via Mattermost when the door has been left open |
206 |
| - for more than 5 minutes. This turned out to be a super fun project. I used |
207 |
| - parts on hand as much as possible, implemented the monitoring application in |
208 |
| - Rust, and then built a stripped down Linux image to run it. |
209 |
| - </p> |
210 |
| - </div> |
211 |
| - |
212 |
| - <a href="https://www.wezm.net/v2/posts/2022/garage-door-monitor/">Continue Reading →</a> |
213 |
| - </article> |
214 |
| - |
215 |
| - <article id="monospace-kobo-ereader"> |
216 |
| - <!-- another article --> |
217 |
| - </article> |
218 |
| - |
219 |
| - <!-- more articles --> |
220 |
| - |
221 |
| - <a href="https://www.wezm.net/v2/posts/">View more posts →</a> |
222 |
| -</section> |
223 |
| -``` |
224 |
| - |
225 |
| -#### More Detail on Date Handling |
226 |
| - |
227 |
| -The `date` key in the configuration can be a string or a table. If it's a |
228 |
| -string then it's used as selector to find the element containing the date and |
229 |
| -`rsspls` will attempt to automatically parse the value. If automatic parsing |
230 |
| -fails you can manually specify the format using the table form of `date`: |
231 |
| - |
232 |
| -```toml |
233 |
| -[feed.config.date] |
234 |
| -selector = "time" # required |
235 |
| -type = "Date" |
236 |
| -format = "[day padding:none]/[month padding:none]/[year]" |
237 |
| -``` |
238 |
| - |
239 |
| -* `type` is `Date` when you want to parse just a date. Use `DateTime` if you're |
240 |
| - parsing a date and time with the format. Defaults to `DateTime`. |
241 |
| -* `format` is a format description using the syntax described on this page: |
242 |
| - <https://time-rs.github.io/book/api/format-description.html>. |
243 |
| - |
244 |
| -If the element matched by the `date` selector is a `<time>` element then |
245 |
| -`rsspls` will first try to parse the value in the `datetime` attribute if |
246 |
| -present. If the attribute is missing or the element is not a `time` element |
247 |
| -then `rsspls` will use the supplied format or attempt automatic parsing of the |
248 |
| -text content of the element. |
249 |
| - |
250 |
| -### Hosting |
251 |
| - |
252 |
| -It is expected that `rsspls` will be run on a web server that is serving the |
253 |
| -directory the feeds are written to. `rsspls` just generates the feeds, it's not |
254 |
| -a server. In order to have the feeds update you will need to arrange for |
255 |
| -`rsspls` to be run periodically. You might do this with [cron], [systemd |
256 |
| -timers][timers], or the Windows equivalent. |
257 |
| - |
258 |
| -### Caveats |
259 |
| - |
260 |
| -`rsspls` just fetches and parses the HTML of the web page you specify. It does |
261 |
| -not run JavaScript. If the website is entirely generated by JavaScript (such as |
262 |
| -Twitter) then `rsspls` will not work. |
263 |
| - |
264 |
| -### Caching |
265 |
| - |
266 |
| -When websites respond with cache headers `rsspls` will make a conditional |
267 |
| -request on subsequent runs and will not regenerate the feed if the server |
268 |
| -responds with 304 Not Modified. Cache data is stored in |
269 |
| -`$XDG_CACHE_HOME/rsspls`, which defaults to `~/.cache/rsspls` on UNIX-like |
270 |
| -systems or `C:\Users\You\AppData\Local\rsspls` on Windows. |
| 42 | +<div align="center"> |
| 43 | + <a href="https://rsspls.7bit.org/"><img src="visit-website.png" width="198" alt="Visit Website"></a> |
| 44 | +</div> |
271 | 45 |
|
272 | 46 | Build From Source
|
273 | 47 | -----------------
|
@@ -302,7 +76,4 @@ This project is dual licenced under either of:
|
302 | 76 | at your option.
|
303 | 77 |
|
304 | 78 | [rustup]: https://www.rust-lang.org/tools/install
|
305 |
| -[toml]: https://toml.io/ |
306 |
| -[selectors]: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors |
307 |
| -[cron]: https://en.wikipedia.org/wiki/Cron |
308 |
| -[timers]: https://wiki.archlinux.org/title/Systemd/Timers |
| 79 | +[website]: https://rsspls.7bit.org/ |
0 commit comments