A Matrix bot for reading JSON feeds, using the same output format as the RSS integration.
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.
Artemis eebbd701e2
L: Removed an unnecessary open() call.
1 year ago
.gitignore Don't need that one anymore 3 years ago
README.md T.: Figured twas useful'f't didn't generate hundredsa sessions, lmao. So using access tokens rather than passwords now. 1 year ago
UNLICENSE Add Unlicense 3 years ago
jsonfeed-bot.py L: Removed an unnecessary open() call. 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"
    ]
}