feed-to-muc/README.md

76 lines
2.4 KiB
Markdown
Raw Normal View History

2018-07-15 12:23:11 +02:00
# feed-to-muc
2018-07-13 22:53:22 +02:00
## about
**feed-to-muc is no more actively developed.** It works ok enough and
I am not interested to add more features or fix corner cases where
it might fail. If you're looking for an actively developed alternative
you might want to have a look at [Morbot](https://codeberg.org/TheCoffeMaker/Morbot).
2018-07-15 20:26:09 +02:00
*feed-to-muc* is an XMPP bot which queries Atom or RSS newsfeeds and
2018-07-13 22:53:22 +02:00
posts the short summary to a XMPP MUC if there is a new article.
## disclaimer
I am no programmer and this bot is a result of a lot of *try and error*.
2018-07-15 12:23:11 +02:00
There are probably lots of quirks that are remains of some wrong paths
2018-07-13 22:53:22 +02:00
I went in between. Also a lot is probably solved in a *hacky way* due
2018-07-15 12:23:11 +02:00
to missing experience.
2018-07-13 22:53:22 +02:00
Anyway, it works (for me at least) and so I upload this here.
Recommendations about what can be done better improved and so on are
very welcome.
## requirements
2023-03-10 11:25:38 +01:00
* [go](https://golang.org/) >= 1.18
2018-07-13 22:53:22 +02:00
## installation
2023-03-10 11:20:15 +01:00
You will find the binary in `$GOPATH/bin` or, if set, `$GOBIN`.
```plain
$ go install salsa.debian.org/mdosch/feed-to-muc@latest
2023-03-10 11:20:15 +01:00
```
2018-07-13 22:53:22 +02:00
## configuration
2018-07-15 20:44:08 +02:00
If the flag `-config` is not used the configuration is expected at
`$HOME/.config/feed-to-muc/config.json` in this format:
2018-07-13 22:53:22 +02:00
2018-07-15 12:23:11 +02:00
```json
2018-07-13 22:53:22 +02:00
{
"ServerAddress": "example.com:5222",
"BotJid": "feedbot@example.com",
"Password": "ChangeThis!",
"Muc": "muc-to-feed@conference.example.com",
"MucNick": "feedbot",
"Contact": "xmpp:botadmin@example.com",
2018-07-13 22:53:22 +02:00
"MaxArticles": 5,
"RefreshTime": 30,
"NoExcerpt": false,
"Quiet": false,
"Filter": [ "submitted by", "[link]" ],
"FilterMessage": [ "Block me!", "Block me too!" ],
2018-07-15 12:23:11 +02:00
"Feeds": [ "https://www.debian.org/News/news",
"https://www.debian.org/security/dsa-long",
"https://www.reddit.com/r/FDroidUpdates/new.rss" ]
2018-07-13 22:53:22 +02:00
}
```
`MaxArticles` is the maximum number of articles that are sent per
feed and query. If `NoExcerpt` is set to *true* no excerpt will be
2022-08-21 12:07:30 +02:00
posted. `RefreshTime` defines the interval for checking the feeds
in seconds.
With `Filter` you can specify strings for filtering out lines
beginning with those strings, with `FilterMessage` you can filter
out complete postings containing the string.
`Contact` is for providing contact information about who is running
the bot.
If you don't want additional noise in the MUC you can set `Quiet`
to disable bot queries (e.g. *contact*) in the MUC (queries per
private message are still available).