-
-
Save stephlocke/fd8de6d6a1206dec900e1d78b61226c6 to your computer and use it in GitHub Desktop.
A visit to Durham
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rtweet) #rtweet API creds should already be set up | |
library(stringi) | |
library(dplyr) | |
friends = get_friends(user="stephlocke") | |
followers = get_followers("stephlocke") | |
tweeps_id = distinct(bind_rows(friends, followers)) | |
tweeps_info = lookup_users(tweeps_id$user_id) | |
# A regex for a visit to Durham | |
nc_regex = "(Dublin|dublin)" | |
nc_tweeps_info = tweeps_info %>% | |
filter(stri_detect_regex(paste(name, screen_name, location, description), | |
nc_regex, case_insensitive=TRUE)) | |
nc_tweeps_info %>% | |
dplyr::select(name, screen_name, description, location) %>% | |
arrange(location) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment