From c7b214387dcaa61fa70b37c516538d3f186ee124 Mon Sep 17 00:00:00 2001 From: 50501AZ Webmaster Date: Thu, 26 Jun 2025 16:40:49 -0700 Subject: [PATCH] Fork for RSS consumer --- base-config.yaml | 13 ++++--------- consumerntfy.py => consumerrss.py | 4 ++-- maubot.yaml | 8 +++++--- readme.md | 6 ++++-- 4 files changed, 15 insertions(+), 16 deletions(-) rename consumerntfy.py => consumerrss.py (97%) diff --git a/base-config.yaml b/base-config.yaml index 07fedc5..e496539 100644 --- a/base-config.yaml +++ b/base-config.yaml @@ -15,15 +15,10 @@ allowed_regions: # Bot-specific configurations per region region_configs: - arizona: - # Where and how the plugin will send the data to - server_url: "https://ntfy.sh" - server_topic: "changeme" - - # If the plugin should use a username and password to send notifications - server_use_authentication: true - server_username: "no" - server_password: "way" + __global__: true + arizona: true + california: true + somethingyoudontwantanrssfor: true # If this bot should send a reaction to the message # if the notification was successful diff --git a/consumerntfy.py b/consumerrss.py similarity index 97% rename from consumerntfy.py rename to consumerrss.py index 822d18d..a075d6e 100644 --- a/consumerntfy.py +++ b/consumerrss.py @@ -15,7 +15,7 @@ class Config(BaseProxyConfig): helper.copy("region_configs") helper.copy("send_reaction") -class ConsumerNTFY(Plugin): +class ConsumerRSS(Plugin): # Get configuration at startup async def start(self) -> None: self.config.load_and_update() @@ -34,7 +34,7 @@ class ConsumerNTFY(Plugin): # Check that config value exists if not self.config["allowed_regions"]: return False # Check that region is allowed - if not self.config["allowed_regions"][region]: return False + if not region in self.config["allowed_regions"]: return False # All senders allowed for this region if len(self.config["allowed_regions"][region]) == 0: return True # Check that sender is allowed for region diff --git a/maubot.yaml b/maubot.yaml index 899e4fe..59ce33b 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,10 +1,12 @@ maubot: 0.1.0 -id: org.fiftyfiftyonearizona.reports.consumerntfy +id: org.fiftyfiftyonearizona.reports.consumerrss version: 1.1.0 license: MIT modules: - - consumerntfy -main_class: ConsumerNTFY + - consumerrss +main_class: ConsumerRSS config: true +database: true +webapp: true extra_files: - base-config.yaml \ No newline at end of file diff --git a/readme.md b/readme.md index 4b621b7..e23b655 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,7 @@ -# FiftyFiftyOneArizona's Matrix-Based Reporting System, NTFY Consumer +# FiftyFiftyOneArizona's Matrix-Based Reporting System, RSS Consumer Please see https://git.fiftyfiftyonearizona.org/webmaster/matrix-report-documentation -This plugin supports whitelisting state/territory designators, allowed senders, reaction receipt, and authenticated NTFY posting. \ No newline at end of file +This plugin supports whitelisting state/territory designators, allowed senders, and reaction receipts. It also has separate RSS feeds for each reigon, and a global feed. + +Feeds will be available at `http://your.maubot.instance/_matrix/maubot/plugin//.rss`. where `reigon` is non-case-sensitive. Please see https://docs.mau.fi/maubot/dev/handlers/web.html to double check what this path should be exactly. \ No newline at end of file