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") # Load rtweet | |
library("httpuv") # Authenticate without Twitter Developer account | |
library("tidyverse") # Load tidyverse for ggplot and magrittr | |
library("scales") # Customize axes | |
trends_avail <- trends_available() # Check locales | |
dc_trends <- get_trends("washington") # Set to Washington DC | |
dc_trends %>% | |
subset(!is.na(tweet_volume) & tweet_volume >= 50000) %>% # Remove NA and low volume trends |
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
# -----Set up environment ----- | |
library(tidyverse) | |
library(rvest) | |
# ===== Scrape Transcript ===== | |
## Scrape episode 1 HTML as list | |
ep01_html <- 'https://www.datacamp.com/community/blog/data-science-past-present-future' | |
## Creates a list of lists of HTML load | |
ep01_webpage <- read_html(ep01_html) |
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
# ----- Load libraries ----- | |
library("rtweet") | |
library("devtools") | |
library("tidyverse") | |
library("gridExtra") | |
# ----- Connection data (removed) ----- | |
appname <- "" # name of twitter app | |
key <- "" # api key | |
secret <- "" # api secret |