knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This package accesses documents from open archives and tweets the latest scientific publications of your team (see it in action: \@archeosciences).
You you can install the development version from GitHub with:
# install.packages("remotes") remotes::install_github("crp2a/twitterbot")
library(twitterbot)
twitterbot currently supports:
get_hal_team()
(team) or get_hal_author()
(personnal).get_rss()
You can schedule a cron job with cronR or use GitHub actions to schedule tweets on a daily basis.
## Set the path of the log file ## This file ensures that no document is tweeted twice path <- file.path(Sys.getenv("HOME"), "hal.log") ## Get documents from HAL hal <- get_hal_team(id = "399901", limit = 100) ## Post the last ten publications post(hal, log = path, select = 1:10)
hal <- get_hal_team(id = "399901", limit = 10) tweet <- compose(hal[[10]]) attributes(tweet) <- NULL
r tweet
## Set the path of the log file ## This file ensures that no document is tweeted twice path <- file.path(Sys.getenv("HOME"), "rss.log") ## Get news items url <- "https://www.archeosciences-bordeaux.fr/spip.php?page=backend-breves" rss <- get_rss(feed = url) ## Post the last ten items post(rss, log = path, select = 1:10)
url <- "https://www.archeosciences-bordeaux.fr/spip.php?page=backend-breves" rss <- get_rss(feed = url, limit = 90 * 24 * 60 * 60) tweet <- compose(rss[[1]]) attributes(tweet) <- NULL
r tweet
Please note that the twitterbot project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.