Skip to content

Commit

Permalink
Add name of paper
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Mar 6, 2024
1 parent 243ad96 commit 2c31442
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/citations.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ get_citation_count <- function(paper_cite_link) {

response <- httr::GET(paper_cite_link)

if (httr::status_code(response) != 200) {
httr::stop_for_status(response)
}

original_paper <- rvest::read_html(httr::content(response, "text")) %>%
rvest::html_nodes('h2.gs_rt') %>%
rvest::html_text()

titles <- rvest::read_html(httr::content(response, "text")) %>%
rvest::html_nodes('h3') %>%
rvest::html_text()
Expand All @@ -34,6 +42,6 @@ get_citation_count <- function(paper_cite_link) {
rvest::html_nodes("a") %>%
rvest::html_attr("href")

df <- data.frame(titles, links)
df <- data.frame(original_paper, cite_titles, links)
return(df)
}

0 comments on commit 2c31442

Please sign in to comment.