Crates.io | smfnotify |
lib.rs | smfnotify |
version | 0.5.0 |
source | src |
created_at | 2022-05-08 15:59:55.292787 |
updated_at | 2023-02-03 00:21:50.38279 |
description | Notify webhook of new posts in Simple Machines Forum instance |
homepage | https://homework.nwsnet.de/releases/56c7/#smfnotify |
repository | https://github.com/homeworkprod/smfnotify |
max_upload_size | |
id | 582594 |
size | 48,562 |
Announce new threads and posts in a Simple Machines Forum instance by sending HTTP requests to a configurable webhook endpoint.
SMFNotify is intended to be invoked regularly, for example every few minutes (depending on the activity of the monitored forum and how quickly people want to be informed about new posts).
Each invocation fetches the feed, looks for new entries, and calls the webhook for each one before exiting.
A configuration file is mandatory to run it:
$ smfnotify --config config_example.toml
An example configuration file is included as config_example.toml
and
looks like this:
feed_url = "https://forum.example.com/index.php?action=.xml;type=atom"
feed_cookie_value = "<insert value of your 'SMFCookie10' cookie>"
feed_max_new_entries = 5
last_processed_id_filename = "last_processed_id"
webhook_text_template = "{author} posted to forum: \"{title}\" - <{url}>"
webhook_url = "http://127.0.0.1:8080/<your-webhook-path>"
interval_in_seconds = 120
To obtain the cookie value, log in to the forum, then use your web
browser's debugger or an extension to look up the cookie named
SMFCookie10
.
The interval is optional. If it is not set, SMFNotify will only fetch and potentially notify about new entries just once, then exit.
Both a Dockerfile
and a compose.yaml
are included to support
running SMFNotify with Docker and Docker Compose.
Be sure to provide:
config.toml
(and configure an interval)
andlast_processed_id
file (can be empty; create with touch last_processed_id
)to avoid issues.
SMFNotify is a port of a Python script I wrote in October 2015.
SMFNotify is licensed under the MIT license.
Copyright 2022-2023 Jochen Kupperschmidt