-
-
Save soodoku/092bde4ca8bf439dddcd5b6bdff87e10 to your computer and use it in GitHub Desktop.
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
devtools::install_github("abresler/gdeltr2") | |
devtools::install_github("hafen/trelliscopejs") | |
library(gdeltr2) | |
library(dplyr) | |
asb_ocr <- "Brooklyn Nets" | |
gkg_codes <- | |
get_codes_gkg_themes() | |
imageweb_codes <- get_gdelt_codebook_ft_api(code_book = "imageweb") | |
imagetag_codes <- get_gdelt_codebook_ft_api(code_book = "imagetags") | |
tp_terms <- | |
c('"Elon Musk"', | |
'"Cormac McCarthy"', | |
'"Quentin Tarantino"', | |
'"Giannis Antetokounmpo"', | |
'"Jason Kidd"', | |
'"Trey Parker"') | |
tp_domains <- | |
c("brewhoop.com", "verge.com", "netsdaily.com", "polygon.com") | |
tp_image_web <- | |
c("Giannis Antetokounmpo" "Jeremy Lin") | |
asb_ocr <- "Brooklyn Nets" | |
get_data_ft_v2_api( | |
domains = tp_domains, | |
terms = tp_terms, | |
images_ocr = asb_ocr, # any OCR text | |
images_web_tag = tp_imageweb, # any imageweb tag | |
images_tag = NA, # any imagetag | |
timespans = NA, | |
gkg_themes = "econ_bitcoin", | |
modes = "timelinevolinfo" | |
) | |
## Timeline | |
get_data_ft_v2_api( | |
domains = tp_domains, | |
terms = tp_terms, | |
images_ocr = asb_ocr, # any OCR text | |
images_web_tag = tp_imageweb, # any imageweb tag | |
images_tag = NA, # any imagetag | |
timespans = "12 weeks", | |
gkg_themes = "econ_bitcoin", | |
modes = "timelinevolinfo" | |
) | |
## Wordcloud | |
get_data_ft_v2_api( | |
domains = tp_domains, | |
terms = tp_terms, | |
images_ocr = asb_ocr, | |
images_web_tag = tp_imageweb, | |
timespans = "12 weeks", | |
gkg_themes = "econ_bitcoin", | |
modes = c( | |
"WordCloudImageWebTags", | |
"WordCloudImageTags", | |
"WordCloudEnglish", | |
"WordCloudTheme" | |
) | |
) | |
## Images -- TAKES A WHILE using dates -- for shorter use timespan | |
get_data_ft_v2_api( | |
domains = tp_domains, | |
terms = tp_terms, | |
images_ocr = asb_ocr, # any OCR text | |
images_web_tag = tp_imageweb, # any imageweb tag | |
images_tag = NA, # any imagetag | |
timespans = NA, | |
dates = gdeltr2::generate_dates(), | |
gkg_themes = "econ_bitcoin", | |
modes = "timelinevolinfo" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment