Skip to content

SaMeHub/cds_paper_bot

 
 

Repository files navigation

CDS Paper Bot

DOI

This is a Twitter bot written in python (version 3) that reads the RSS feeds of the CERN Document Server (CDS) and creates tweets of new publications.

It currently works pretty well for the ATLAS and CMS feeds listed in feeds.ini, could probably easily be extended to the LHCb and ALICE ones listed in the file already.

Follow the bots on twitter @CMSpapers, @ATLASpapers/@ATLAS_results, and @LHCb_results.

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 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.

Docker image

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

Deploying the bot to GitLab CI/CD

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.

About

Bot that parses CERN CDS RSS feeds and posts updates on twitter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.8%
  • Shell 1.3%
  • Dockerfile 0.9%