This repository collects twitter data and stores it to my own personal s3 bucket. More specifically, itβ¦
- Uses
rtweet
to search for tweets with βlebronβ in the text. - Compares new tweets to tweets that I have already collected by filtering out status IDs that already exist.
- Saves the dataset to a personal s3 bucket.
- Does this daily using a cron job from
cronR
.
I have no real use case for this at the moment. I am more or less just interested in setting up a job to collect data. I think of it as a kind of template that I may come back to if there is any twitter data Iβd like to routinely collect.
library(dplyr)
library(aws.s3)
library(stringr)
library(tidyr)
library(emo)
df <- s3readRDS("lebron_tweets.rds", "tylerlittlefield")
df %>%
distinct(text) %>%
mutate(emojis = ji_extract_all(text)) %>%
unnest_longer(emojis) %>%
drop_na(emojis) %>%
count(emojis, sort = TRUE)
#> # A tibble: 776 x 2
#> emojis n
#> <chr> <int>
#> 1 π 5445
#> 2 π€£ 1543
#> 3 π₯ 1118
#> 4 π 1110
#> 5 π 813
#> 6 π 464
#> 7 π€ 446
#> 8 π 441
#> 9 π 397
#> 10 π 377
#> # β¦ with 766 more rows