Last active
September 26, 2017 18:47
-
-
Save abresler/b7e6528ecc4bcb1afd9276ae307206e1 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/fundManageR") | |
gdeltr2::load_needed_packages(c("dplyr", "fundManageR", "tidyr", "stringr", "purrr", "glue")) | |
kris_managers <- | |
c("Quantam Utility", | |
"First Reserve", | |
"EIG Partners", | |
"Energy Capital") | |
df_kk <- | |
get_data_adv_managers_filings(entity_names = kris_managers, all_sections = TRUE) | |
funds <- | |
section7BPrivateFundReporting %>% | |
distinct(nameFundClean) %>% | |
pull() %>% | |
str_trim() %>% | |
str_replace_all(" ", " ") | |
targeted_google_search <- | |
function(funds, hitwords = c('IRR', '"PPM"', '"Private Placement"'), file_type = "PDF", sleep = 5) { | |
google <- | |
"https://www.google.com/search?q=" | |
funds %>% | |
walk(function(x){ | |
name_specific <- | |
glue::glue('"{x}"') | |
if (!file_type %>% purrr::is_null()) { | |
file_slug <- glue::glue("filetype:{file_type}") | |
} else { | |
file_slug <- "" | |
} | |
urls <- | |
glue::glue("{google}{name_specific} {hitwords} {file_slug}") | |
urls <- urls %>% as.character() %>% map(URLencode) %>% flatten_chr() | |
urls %>% | |
walk(function(x){ | |
x %>% browseURL() | |
Sys.sleep(time = sleep) | |
}) | |
}) | |
} | |
targeted_google_search(funds = funds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment