From your favorite RSS feeds, spread/share those news to services of your choice
- RSS
- Mastodon
- Mattermost
- Slack
- Discord
- Telegram
- Wallabag
- Local Markdown files
- Any services using a Webhook to push data
-
With Yeoboseyo you set an RSS URL and the "local storage" (the folder where to store news in markdown) then you synchronize those files with syncthing on any of your devices and read them with Espilon Notes, Notable, markor. Any markdown editor/reader can open/import those files. This use case can be extended to any application that is able to import markdown file, use file manager or has import function, like TagSpaces
-
You want to publish news from your favorite news websites to
Mastodon
, Yeoboseyo will do that without any problem -
You need to spread news from your project on
Mattermost
/Slack
/Discord
, just set the URL of theWebhook
of one of those services and the news will be published as expected on thechannel
of your choice -
If you prefer to publish that on
Telegram
, set theTELEGRAM_CHAT_ID
of the group or channel
Let see how to setup all of that below
- python 3.8+
- starlette (the web application)
- feedparser (for RSS support)
- pypandoc (to convert html to markdown)
- wallabag API for Wallabag readit later applications
create a virtualenv
python3 -m venv yeoboseyo
cd yeoboseyo
source bin/activate
then
pip install -r requirements.txt
or
pip install yeoboseyo
copy or rename the config file
mv env.sample .env
set the correct values for your own environment
DATABASE_URL=sqlite:https:///db.sqlite3
TIME_ZONE=Europe/Paris
FORMAT_FROM=markdown_github
FORMAT_TO=html
BYPASS_BOZO=False # if you don't want to get the malformed RSS Feeds set it to False
LOG_LEVEL=logging.INFO
MASTODON_USERNAME=your username@<domain instance of mastodon>
MASTODON_PASSWORD=your pass
MASTODON_INSTANCE=https://<domain instance of mastodon>
MASTODON_VISIBILITY=unlisted # default is 'public', can be 'unlisted', 'private', 'direct'
TOKEN=''
TELEGRAM_TOKEN=0123456789:AZERTYUIOPQSDFGHJKLMWXCVBN123456789
TELEGRAM_CHAT_ID=-NNNNNNNNN
WALLABAG_URL=http:https://wallabag/
WALLABAG_CLIENTID=your id
WALLABAG_CLIENTSECRET=your secret
WALLABAG_PASSWORD=wallabag
WALLABAG_USERNAME=wallabag
to create the app on mastodon :
on https://yourmastoinstance/settings/applications/new
- Application name :
Yeoboseyo
- Scopes : check :
read
/write
/push
/follow
- then
submit
then select Yeoboseyo again to retreive the access token, and fill the file yeoboseyo_clientcred.secret
put on the first line the value of "Your access token" and on the second line the https url of your masto instance eg
Azdfghy5678hefdsgghjuju09knb
https://framapiaf.org
this file will be read each time something will be posted on masto
in the 'integrations' page set an "incoming webhooks" (eg from https://mattermost/teamname/integrations) and copy the URL into the field 'webhook' of the Yeoboseyo form
you will need to create a Telegram Bot
by invoking @BotFather.
Once the bot is created, create a group / channel, and invite your bot on that group/channel and give it admin rights.
Now you need to get the ID of the group / channel where the bot can "speak"
for that : access to your bot history url
https://api.telegram.org/botXXXXX:YYYYY/getUpdates
and spot this kind of data
chat:
id: -NNNNNN
title: "my group name"
pick up the -NNNNNN
and put it as the TELEGRAM_CHAT_ID
in the .env
config file
Create a client API like explain here https://doc.wallabag.org/fr/developer/api/oauth.html
this will give you something like this
Then replace the client_id / client_secret / login / pass in the .env file
WALLABAG_URL=http:https://wallabag/
WALLABAG_CLIENTID=your id
WALLABAG_CLIENTSECRET=your secret
WALLABAG_PASSWORD=wallabag
WALLABAG_USERNAME=wallabag
create the database (to execute only once)
python models.py
start the application
cd yeoboseyo
python app.py &
μ¬λ³΄μΈμ !
INFO: Started server process [13588]
INFO: Waiting for application startup.
INFO: Uvicorn running on http:https://0.0.0.0:8000 (Press CTRL+C to quit)
Go on http:https://0.0.0.0:8000
and fill the form to add new Feeds to track
- If you plan to publish RSS Feeds
- into a
local folder
, fill thelocal storage
field with the complet path of that folder, if not leave it empty. - on your
Mastodon
account, tick the checkboxPublish on Mastodon?
, if not, leave it unchecked - on your
Telegram
group/channel tick the checkboxPublish on Telegram?
, if not, leave it unchecked - on your
Mattermost
/Slack
/Discord
group/channel, just set the URL of theWebhook
of one of those services, if not, leave it empty.
- into a
now that you fill settings, and form, launch the command and see how many feeds are comming
μ¬λ³΄μΈμ !
usage: python run.py [-h] -a {report,go,switch} [-trigger_id TRIGGER_ID]
Yeoboseyo
optional arguments:
-h, --help show this help message and exit
-a {report,go,switch}
choose -a report or -a go or -a swtch -trigger_id <id>
-trigger_id TRIGGER_ID
trigger id to switch of status
python run.py -a go
μ¬λ³΄μΈμ ! RUN and GO
Trigger FoxMasK blog
Entries created 1 / Read 1
get the list of your feeds to check which one provided articles or not
$ python run.py -a report
μ¬λ³΄μΈμ !
Report
ββββββ³ββββββββββββββββββββββ³ββββββββββββ³ββββββββββ³βββββββββ³βββββββββββββββββββββββββββββ
β ID β Name β Md Folder β Tags β Status β Triggered β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 1 β Mon Blog β test β News β Ok β 2021-03-18 22:35:21 β
β 2 β KBS Culture β test β News β Ok β 2021-04-05 09:59:03 β
β 3 β KBS journal du jour β test β News β Ok β 2021-04-05 09:59:05 β
β 4 β KBS Show biz β test β News β Ok β 2021-04-05 09:59:06 β
β 5 β Jux Video β test β jeux β Ok β 2021-04-01 22:22:15.113871 β
β 6 β PlayStation Blog β test β jeux β Ok β 2021-04-01 22:22:57.189312 β
β 7 β GameKult β test β jeux β Ok β 2021-04-01 22:23:21.049307 β
β 8 β Gameblog β test β jeux β Ok β 2021-04-01 22:23:48.350934 β
β 9 β NoFrag β test β jeux β Ok β 2021-04-01 22:24:15.721174 β
β 10 β Frandroid β test β android β Ok β 2021-04-01 22:24:47.324475 β
β 11 β Les Numeriques β test β android β Ok β 2021-04-01 22:25:09.740677 β
β 12 β VueJS News β test β vuejs β Ok β 2021-04-01 22:25:34.307735 β
β 13 β Cacktus Blog β test β python β Ok β 2021-04-01 22:26:02.412688 β
β 14 β Python News β test β python β Ok β 2021-04-01 22:26:41.975564 β
β 15 β nedbatchelder β test β python β Ok β 2021-04-01 22:28:21.838166 β
β 16 β Django News β test β Python β Ok β 2021-04-01 22:28:47.804644 β
β 17 β Python Insider β test β Python β Ok β 2021-04-01 22:29:18.791661 β
β 18 β PyCharm Blog β test β Python β Ok β 2021-04-01 22:29:44.568828 β
β 19 β Real Python β test β Python β Ok β 2021-04-01 22:30:10.952486 β
β 20 β VueJS β test β VueJS β Ok β 2021-04-01 22:30:34.507337 β
β 21 β Odieux Connard β test β Humour β Ok β 2021-04-01 22:31:03.458147 β
ββββββ΄ββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββ΄βββββββββ΄βββββββββββββββββββββββββββββ
switch the status of trigger to on/off
python run.py -a switch -trigger_id 1
μ¬λ³΄μΈμ ! Switch
Successfully disabled Trigger 'Mon Blog'
and check it again to see the status moving
09:00 $ python run.py -a report
μ¬λ³΄μΈμ !
Report
ββββββ³ββββββββββββββββββββββ³ββββββββββββ³ββββββββββ³βββββββββββ³βββββββββββββββββββββββββββββ
β ID β Name β Md Folder β Tags β Status β Triggered β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 1 β Mon Blog β test β News β Disabled β 2021-05-15 09:00:27 β
β 2 β KBS Culture β test β News β Ok β 2021-04-05 09:59:03 β
β 3 β KBS journal du jour β test β News β Ok β 2021-04-05 09:59:05 β
β 4 β KBS Show biz β test β News β Ok β 2021-04-05 09:59:06 β
β 5 β Jux Video β test β jeux β Ok β 2021-04-01 22:22:15.113871 β
β 6 β PlayStation Blog β test β jeux β Ok β 2021-04-01 22:22:57.189312 β
β 7 β GameKult β test β jeux β Ok β 2021-04-01 22:23:21.049307 β
β 8 β Gameblog β test β jeux β Ok β 2021-04-01 22:23:48.350934 β
β 9 β NoFrag β test β jeux β Ok β 2021-04-01 22:24:15.721174 β
β 10 β Frandroid β test β android β Ok β 2021-04-01 22:24:47.324475 β
β 11 β Les Numeriques β test β android β Ok β 2021-04-01 22:25:09.740677 β
β 12 β VueJS News β test β vuejs β Ok β 2021-04-01 22:25:34.307735 β
β 13 β Cacktus Blog β test β python β Ok β 2021-04-01 22:26:02.412688 β
β 14 β Python News β test β python β Ok β 2021-04-01 22:26:41.975564 β
β 15 β nedbatchelder β test β python β Ok β 2021-04-01 22:28:21.838166 β
β 16 β Django News β test β Python β Ok β 2021-04-01 22:28:47.804644 β
β 17 β Python Insider β test β Python β Ok β 2021-04-01 22:29:18.791661 β
β 18 β PyCharm Blog β test β Python β Ok β 2021-04-01 22:29:44.568828 β
β 19 β Real Python β test β Python β Ok β 2021-04-01 22:30:10.952486 β
β 20 β VueJS β test β VueJS β Ok β 2021-04-01 22:30:34.507337 β
β 21 β Odieux Connard β test β Humour β Ok β 2021-04-01 22:31:03.458147 β
ββββββ΄ββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββ΄βββββββββββ΄βββββββββββββββββββββββββββββ
if you had the version 0.5.0:
run
migrations/alter_table_trigger_add_telegram.sql
migrations/alter_table_trigger_add_wallabag.sql
if you had the version 0.4.0:
run
migrations/alter_table_trigger_add_webhook.sql
(Image credits to Emojipedia)
export TEST_DATABASE_URL=sqlite:https:///db_test.sqlite3
pytest
[...]
yeoboseyo/tests/test_models.py .. [ 66%]
yeoboseyo/tests/test_settings.py . [100%]
===================================================================== 3 passed in 0.52s ======================================================================
or
coverage run --source='.' -m pytest
coverage report -m