This Python bot posts RSS news from your chosen feeds. You can choose the frequency of posting (in minutes) and the amount of Notes to post each time.
Before posting it starts a sentiment analysis then flags with CW (Content Warning) and :NSFW: if sentiment is negative. (war, deaths, bad news)
News and Notes flows are asyncronous, so that it can pick up always the fresher news and Note as soon as possible.
Notes will not bloat your Misskey profile, because get deleted if older than a month.
Please, follow this instructions once, before starting:
- Get inside your Misskey instance
- Create a new account
- Remember to set
isBot = True
- Visit the page:
https://your.misskey.instance/settings/api
- Create a new API-key having at minimum
notes:write
privilege.
Please use python3. In latest GNU/Linux distros, it's already in as default. Otherwise you'll need python3-venv
package with dependencies.
git clone
this repository, to get the source code, or download the zip filepython -m venv .venv
Python sandboxed enviroment creation. .venv/bin/activate
Environment activationpip install -r requirements.txt
Dependencies installationpython -m spacy download en_core_web_lg
Gets sentiment analysis data (for NSFW posts)
Now you installed the software, you need a small amount of configuration.
First of all, put the RSS Feed source URLS into the file sources.txt
, line by line.
Now copy .env-example
in .env
file to fill in your personal configuration:
- HOST your Misskey domain
- APIKEY app's credentials created before
- VISIBILITY choose in which Timeline to post.
- LOCAL boolean for federated Notes
- EVERY_MINUTES posting frequency
- HOW_MANY posted Notes amount
Inside your python environment:
(env) $ python feed_bot.py
It will setup if needed. Then will start three scheduled jobs.
You probably want to run it detached from the console by using nohup
or running into a screen
command. So that you can close the ssh shell without stopping.
The software has ability to avoid multiple concurrent runs.
To stop it, just press CTRL+C
in the console.
To exit the Python environment type: deactivate
. You're aware of activation because of your shell starts with: (env)
It's super easy, just Stop! Then git pull
to check for updates. Then pip-review -a
to update the libraries. Needs a restart to get things done.
If you plan to contribute, please run this command, after installation noted before.
pre-commmit install