A Matrix bot for reading JSON feeds, using the same output format as the RSS integration.
You can not 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 9ea66b6349
T.: Figured twas useful'f't didn't generate hundredsa sessions, lmao. So using access tokens rather than passwords now.
3 months ago
.gitignore Don't need that one anymore 2 years ago
README.md T.: Figured twas useful'f't didn't generate hundredsa sessions, lmao. So using access tokens rather than passwords now. 3 months ago
UNLICENSE Add Unlicense 2 years ago
jsonfeed-bot.py T.: Figured twas useful'f't didn't generate hundredsa sessions, lmao. So using access tokens rather than passwords now. 3 months 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"
    ]
}