feed-to-muc/README.md

73 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

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
`$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]" ],
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
posted. `RefreshTime` defines the intervall for checking the feeds
in seconds.
With `Filter` you can specify strings for filtering out lines
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
private message are still available).