2018-07-15 12:23:11 +02:00
|
|
|
# feed-to-muc
|
|
|
|
|
2018-07-13 22:53:22 +02:00
|
|
|
## about
|
|
|
|
|
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
|
|
|
|
|
|
|
|
* [go](https://golang.org/)
|
|
|
|
|
|
|
|
## installation
|
|
|
|
|
2018-07-15 12:23:11 +02:00
|
|
|
If you have *[GOPATH](https://github.com/golang/go/wiki/SettingGOPATH)*
|
2018-07-13 22:53:22 +02:00
|
|
|
set just run this commands:
|
|
|
|
|
2018-07-15 12:23:11 +02:00
|
|
|
```bash
|
2018-07-13 22:53:22 +02:00
|
|
|
$ go get salsa.debian.org/mdosch-guest/feed-to-muc
|
|
|
|
$ go install salsa.debian.org/mdosch-guest/feed-to-muc
|
|
|
|
```
|
|
|
|
|
|
|
|
You will find the binary in `$GOPATH/bin` or, if set, `$GOBIN`.
|
|
|
|
|
|
|
|
## configuration
|
|
|
|
|
2018-07-15 20:44:08 +02:00
|
|
|
If the flag `-config` is not used the configuration is expected at
|
2018-07-15 12:04:43 +02:00
|
|
|
`$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",
|
2019-05-31 12:04:53 +02:00
|
|
|
"Contact": "xmpp:botadmin@example.com",
|
2018-07-13 22:53:22 +02:00
|
|
|
"MaxArticles": 5,
|
2018-09-05 20:40:41 +02:00
|
|
|
"RefreshTime": 30,
|
|
|
|
"NoExcerpt": false,
|
2019-05-31 12:04:53 +02:00
|
|
|
"Quiet": false,
|
2019-05-31 11:32:13 +02:00
|
|
|
"Filter": [ "submitted by", "[link]" ],
|
2018-07-15 12:23:11 +02:00
|
|
|
"Feeds": [ "https://www.debian.org/News/news",
|
2019-05-31 11:32:13 +02:00
|
|
|
"https://www.debian.org/security/dsa-long",
|
|
|
|
"https://www.reddit.com/r/FDroidUpdates/new.rss" ]
|
2018-07-13 22:53:22 +02:00
|
|
|
}
|
|
|
|
```
|
2018-09-05 20:40:41 +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
|
|
|
|
posted. `RefreshTime` defines the intervall for checking the feeds
|
2019-05-31 11:32:13 +02:00
|
|
|
in seconds.
|
2019-05-31 12:04:53 +02:00
|
|
|
|
2019-05-31 11:32:13 +02:00
|
|
|
With `Filter` you can specify strings for filtering out lines
|
2019-05-31 12:04:53 +02:00
|
|
|
beginning with those strings.
|
|
|
|
|
|
|
|
`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
|
2019-05-31 12:36:30 +02:00
|
|
|
private message are still available).
|