You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 year ago | |
---|---|---|
.gitignore | 3 years ago | |
README.md | 1 year ago | |
UNLICENSE | 3 years ago | |
jsonfeed-bot.py | 1 year ago |
README.md
jsonfeed-bot
A Matrix bot for reading JSON feeds, using the same output format as the RSS integration.
Needs python3 and the matrix-nio library for Python. Two JSON files in the directory where it is run are required: latest.json
, containing the latest item of the feed as a JSON object, and config.json
, which needs a JSON array "rooms"
of the rooms where the bot should post (the bot user needs to be in these rooms to be able to do so, it does not autojoin), as well as the variables "mxid"
, "access_token"
and "server"
.
"access_token"
can be obtained, for example, via the Synapse admin API, or somehow via the standard Matrix client API, though… we couldn't figure out how to do that.
Example for config.json
:
{
"mxid": "@mybot:myserver.tld",
"server": "https://matrix.myserver.tld",
"password": "supersecretpasswordforthemxidofmybot",
"access_token": "randomstringyougotfromlogginginatserver",
"feed": "https://myawesomeblog.xyz/feed.json",
"rooms" [
"!subscribedroomid1:myserver.tld",
"!subscribedroomid2:matrix.org"
]
}