This is a bot written in python (version 3) that reads the RSS feeds of the CERN Document Server (CDS) and creates tweets/toots/skeets of new publications.
It currently works pretty well for the ATLAS and CMS feeds listed in feeds.ini
, and without images also for LHCb and ALICE.
Follow the bots on X:
Follow on Mastodon:
Follow on BlueSky:
To get it to work as a bot, an auth.ini
file containing information in the following format:
[CMS]
BOT_HANDLE = @CMS_results
CONSUMER_KEY = xxxxxxxxxxxxxxxxxxxxxxxxx
CONSUMER_SECRET = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN = xxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN_SECRET = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For more details on authentication, refer to the Twitter Developer Platform.
For using the tool with a Mastodon bot, auth.ini
should contain:
[CMS]
MASTODON_BOT_HANDLE = @[email protected]
MASTODON_ACCESS_TOKEN = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You can obtain the access token by creating a new application on your Mastodon account's application settings (here provided for mastodon.social).
For using the tool with a BlueSky bot, auth.ini
should contain:
[CMS]
BLUESKY_HANDLE = cmspapers.bsky.social
BLUESKY_APP_PASSWORD = xxxx-xxxx-xxxx-xxxx
where BLUESKY_APP_PASSWORD
is the password of the app you created in BlueSky.
For information on running the bot, do
python cds_paper_bot.py --help
Note: if this doesn't work on MacOS, make sure to brew install freetype imagemagick
and export MAGICK_HOME=/opt/homebrew/opt/imagemagick
.
If you would like to run the bot in an isolated environment, e.g. on a Raspberry Pi, you can try to use the Dockerfile. Build the container using:
docker build -t cds_paper_bot .
Then run it from the repository directory:
docker run --rm -ti -v "$(pwd)":/home/app -w /home/app cds_paper_bot python cds_paper_bot.py
Using the CERN GitLab installation and its CI/CD capabilities, you can run the bot such that it regularly checks for new analyses. Follow the instructions here.