Skip to content

Instantly share code, notes, and snippets.

@GiulSposito
Last active October 23, 2019 19:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GiulSposito/62d74ea3a6e703b28167d30afecf5ba9 to your computer and use it in GitHub Desktop.
Save GiulSposito/62d74ea3a6e703b28167d30afecf5ba9 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(glue)
library(lubridate)
post_tweet <- print
tribble(
~local, ~data_str, ~mensagem,
"PUC-Rio", "17/12/2019", "VAMO LÁ PORRA, JÁ TA ACABANDO!!!",
"UFRJ", "14/12/2019", "VAMO LÁ PORRA, DIAS MELHORES VIRÃO!!!",
"UERJ", "07/12/2019", "AGUENTA VAI, JÁ TA ACABANDO!!!",
"UFF", "20/12/2019", "DALE DALE, JÁ TA ACABANDO!!!"
) %>%
mutate(
data = dmy(data_str),
dias_restantes = data-Sys.Date(),
tweet_text = glue("O ano letivo na {local} acaba em: {data_str}. Falta só {dias_restantes} dias. {mensagem}")
) %>%
split(1:nrow(.)) %>%
map(function(each_row){
Sys.sleep(1)
post_tweet(each_row$tweet_text)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment