This twitter bot runs from two simple R scripts:
- When there is an update to our list of archaeology papers with R code https://github.com/benmarwick/ctv-archaeology#publications-that-include-r-code, the script here posts a tweet with details of the new paper.
- Independant of that list, every 30 days the script posts a tweet with details of an informative article about how to make research more reproducible. The article is drawn from this Zotero Group Library
The bot tweets at https://twitter.com/archpaperscode and toots at https://archaeo.social/@archpaperscode
When an update is made to https://github.com/benmarwick/ctv-archaeology#publications-that-include-r-code, GitHub Actions runs on that repository and triggers a run of GitHub Actions on this repository. GitHub Actions runs the R code in the script file on this repository, which analyses the commit history of the repo with the list of papers, extracts the text that was just added, and composes and posts a tweet with that text.
To post to Twitter from GitHub Actions, the Twitter App needs to be generated with elevated access to the V2 API (read and write) - apply for access from essential after generation. Once you have set up the twitter account, you need to set the 4 keys referred to in the R script as secrets in the github repo settings.
MIT for code