Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
eed44fc
Hash entry content if id is missing
rda0 Jan 16, 2020
adae757
Merge pull request #10 from rda0/master
tulir May 16, 2020
391db14
Allow HTML in RSS messages
tulir May 20, 2020
89ebfe7
Add option to send posts as m.text
tulir Jul 1, 2020
c07beb2
Remove loop parameter in asyncio.gather
tulir Jul 13, 2020
44927f2
Add support for JSON feeds
tulir Aug 3, 2020
ad39e34
Fix handling JSON feeds with extra stuff in content-type header
tulir Aug 3, 2020
2079504
Fix handling errors in feed parsing
tulir Aug 3, 2020
21a65bc
Ignore non-problematic feed parsing errors
tulir Aug 3, 2020
135fa77
Create version table before checking database version
tulir Aug 5, 2020
e05ebe5
Remove unused import
tulir Aug 5, 2020
45cafe1
Bump version to v0.2.1
tulir Aug 5, 2020
85e0fd9
Fix getting feed title and other metadata
tulir Aug 5, 2020
f96b220
Bump version to v0.2.2
tulir Aug 7, 2020
334acf1
Add support for JSON feed version 1.1
tulir Aug 7, 2020
be90ee5
Fix replying to template update
tulir Aug 11, 2020
a8784f4
Remove unused import
tulir Oct 22, 2020
794d8e1
Bump version to v0.2.3
tulir Dec 8, 2020
5efba56
Add backoff for fetching feeds that are down
tulir Apr 9, 2021
c185b31
Fix incorrect use of time()
tulir Apr 10, 2021
79cd475
Show erroring feeds in !rss subscriptions
tulir Apr 10, 2021
db49264
Respond with error when trying to subscribe to already subscribed feed
tulir Apr 10, 2021
b3e76c3
Catch individual message send errors separately
tulir Apr 10, 2021
419e137
Add some more logs
tulir Jul 21, 2021
e5380db
Fix feed backoff not being reset correctly
tulir Jul 28, 2021
f93fcb9
Bump version to v0.2.6
tulir Jul 28, 2021
08ff28b
Update CI artifact expiry
tulir Nov 28, 2021
947c474
Strip surrounding whitespace from item summary
tulir Feb 22, 2022
428b471
Add some logs and hacky sorting
tulir Feb 22, 2022
18ef939
Switch to asyncpg for database
tulir Mar 26, 2022
9a75ee4
Make default notification template configurable
tulir Mar 26, 2022
7b609eb
Use different message when there are no subscriptions
tulir Mar 26, 2022
b7e4a2a
Add IF NOT EXISTS for entry table creation
tulir Mar 28, 2022
b9bc6fb
Bump version to 0.3.0
tulir Mar 28, 2022
35f2fe6
Add support for old SQLites
tulir Apr 30, 2022
70eb6ef
Fix Python 3.10 compatibility
tulir Apr 30, 2022
fa34d80
Update and unpin black
tulir Apr 30, 2022
e87f332
Don't break on old mautrix-python versions
tulir Apr 30, 2022
e7af4d2
Bump version to 0.3.1
tulir May 2, 2022
877dcff
Use custom user agent
tulir Jun 18, 2022
30ad459
Move CI script to main maubot repo
tulir Jun 19, 2022
03bb128
Key entries by link if missing ID
AndrewKvalheim Jul 14, 2022
f12d32a
Bump version to 0.3.2
tulir Oct 3, 2022
1a52d18
Show current template if ran without arguments
tulir Feb 21, 2023
ef4915e
Add usage to readme
tulir Feb 21, 2023
eeb71a0
Fix formatting
tulir Feb 21, 2023
b58202e
Merge pull request #35 from AndrewKvalheim/entry-id-fallback
tulir Feb 21, 2023
a8f1340
Update feedparser input
tulir Jan 30, 2025
f62b033
Update linters
tulir Jan 30, 2025
68e5a84
Bump version to v0.4.0
tulir Jan 30, 2025
72d0809
Pass raw data to feedparser. Fixes #59
tulir Jan 30, 2025
81ec8ed
Bump version to 0.4.1
tulir Jan 30, 2025
93984be
Remove sqlite returning special case
tulir May 7, 2025
7df6c62
Add parallelism limit for polling feeds
tulir Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Python lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.13"
- uses: isort/isort-action@master
with:
sortPaths: "./rss"
- uses: psf/black@stable
with:
src: "./rss"
- name: pre-commit
run: |
pip install pre-commit
pre-commit run -av trailing-whitespace
pre-commit run -av end-of-file-fixer
pre-commit run -av check-yaml
pre-commit run -av check-added-large-files
30 changes: 3 additions & 27 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
image: dock.mau.dev/maubot/maubot

stages:
- build

variables:
PYTHONPATH: /opt/maubot

build:
stage: build
except:
- tags
script:
- python3 -m maubot.cli build -o xyz.maubot.$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.mbp
artifacts:
paths:
- "*.mbp"

build tags:
stage: build
only:
- tags
script:
- python3 -m maubot.cli build -o xyz.maubot.$CI_PROJECT_NAME-$CI_COMMIT_TAG.mbp
artifacts:
paths:
- "*.mbp"
include:
- project: 'maubot/maubot'
file: '/.gitlab-ci-plugin.yml'
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3
files: ^rss/.*\.pyi?$
- repo: https://github.com/PyCQA/isort
rev: 6.0.0
hooks:
- id: isort
files: ^rss/.*\.pyi?$
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# rss
A [maubot](https://github.com/maubot/maubot) that posts RSS feed updates to Matrix.

## Usage
Basic commands:

* `!rss subscribe <url>` - Subscribe the current room to a feed.
* `!rss unsubscribe <feed ID>` - Unsubscribe the current room from a feed.
* `!rss subscriptions` - List subscriptions (and feed IDs) in the current room.
* `!rss notice <feed ID> [true/false]` - Set whether the bot should send new
posts as `m.notice` (if false, they're sent as `m.text`).
* `!rss template <feed ID> [new template]` - Change the post template for a
feed in the current room. If the new template is omitted, the bot replies
with the current template.

### Templates
The default template is `New post in $feed_title: [$title]($link)`.

Templates are interpreted as markdown with some simple variable substitution.
The following variables are available:

* `$feed_url` - The URL that was used to subscribe to the feed.
* `$feed_link` - The home page of the feed.
* `$feed_title` - The title of the feed.
* `$feed_subtitle` - The subtitle of the feed.
* `$id` - The unique ID of the entry.
* `$date` - The date of the entry.
* `$title` - The title of the entry.
* `$summary` - The summary/description of the entry.
* `$link` - The link of the entry.
6 changes: 6 additions & 0 deletions base-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Feed update interval in minutes
update_interval: 60
# Maximum backoff in minutes when failing to fetch feeds (defaults to 5 days)
max_backoff: 7200
# How many feeds to poll in parallel? Set to 0 to disable limit.
poll_parallelism_limit: 10
# The time to sleep between send requests when broadcasting a new feed entry.
# Set to 0 to disable sleep or -1 to run all requests asynchronously at once.
spam_sleep: 2
# The prefix for all commands
# It has to be prefixed with ! in matrix to be recognised
command_prefix: "rss"
# Default post notification template for new subscriptions
notification_template: "New post in $feed_title: [$title]($link)"
# Users who can bypass room permission checks
admins:
- "@user:example.com"
4 changes: 3 additions & 1 deletion maubot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
maubot: 0.3.0
id: xyz.maubot.rss
version: 0.1.0
version: 0.4.1
license: AGPL-3.0-or-later
modules:
- rss
Expand All @@ -9,3 +10,4 @@ extra_files:
dependencies:
- feedparser>=5.1
database: true
database_type: asyncpg
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tool.isort]
profile = "black"
force_to_top = "typing"
from_first = true
combine_as_imports = true
known_first_party = ["mautrix", "maubot"]
line_length = 99

[tool.black]
line-length = 99
target-version = ["py310"]
Loading