-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from fhdsl/cansavvy/scholar
Retrieving Citations!
- Loading branch information
Showing
18 changed files
with
376 additions
and
21 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#' Get a list of papers that cite your paper | ||
#' @description This is a function to retrieve a list of papers that cite your papers | ||
#' @param paper_cite_link This is not a google citation page. 1. Go to: https://scholar.google.com/scholar 2. Search for the paper we are looking for the citation count. 3. Then click the Cited by ___ button below the title of the paper 4. Copy and paste this url and put it in this get_citation_count() function | ||
#' @export | ||
#' @return A list of the example datasets available in this package | ||
#' @examples \dontrun{ | ||
#' | ||
#' paper_cite_link <- "https://scholar.google.com/scholar?cites=6140457238337460780" | ||
#' | ||
#' papers_cited_df <- get_citation_count(paper_cite_link) | ||
#' } | ||
get_citation_count <- function(paper_cite_link) { | ||
|
||
base_url <- "https://scholar.google.com/scholar?cites=" | ||
|
||
is_cite_page <- grepl(base_url, paper_cite_link, fixed = TRUE) | ||
|
||
if (!is_cite_page) { | ||
stop("This is not a google citation page. \n", | ||
"1. Go to: https://scholar.google.com/scholar \n", | ||
"2. Search for the paper we are looking for the citation count. \n", | ||
"3. Then click the Cited by ___ button below the title of the paper \n", | ||
"4. Copy and paste this url and put it in this get_citation_count() function") | ||
} | ||
|
||
response <- httr::GET(paper_cite_link) | ||
|
||
titles <- rvest::read_html(httr::content(response, "text")) %>% | ||
rvest::html_nodes('h3') %>% | ||
rvest::html_text() | ||
|
||
links <- rvest::read_html(paper_cite_link) %>% | ||
rvest::html_nodes('h3') %>% | ||
rvest::html_nodes("a") %>% | ||
rvest::html_attr("href") | ||
|
||
df <- data.frame(titles, links) | ||
return(df) | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
##### Checks run at pull request ##### | ||
# Check that urls in the content are not broken | ||
url-checker: yes | ||
# Render preview of content with changes (Rmd's and md's are checked) | ||
render-preview: yes | ||
# Spell check Rmds and quizzes | ||
spell-check: yes | ||
# Style any R code | ||
style-code: yes | ||
|
||
############ Metric Collection Destination ############## | ||
### Options are "github" or "google" | ||
data_dest: github | ||
folder_path: | ||
|
||
###### Calendly ###### | ||
refresh-calendly: yes | ||
calendly_googlesheet: | ||
|
||
###### CRAN ###### | ||
refresh-cran: yes | ||
cran_packages: [ metricminer, ottrpal ] | ||
cran_googlesheet: | ||
|
||
###### GitHub ###### | ||
refresh-github: yes | ||
github_repos: [ fhdsl/metricminer, fhdsl/metricminer.org ] | ||
github_googlesheet: | ||
|
||
###### Google Analytics ###### | ||
refresh-ga: yes | ||
ga_property_ids: [ 422671031, 422558989 ] | ||
ga_googlesheet: | ||
|
||
###### Google Forms ###### | ||
refresh-googleforms: yes | ||
google_forms: [ | ||
1pbFfgUPYH2w9zEoCDjCa4HFOxzEhGOseufw28Xxmd-o, | ||
1JjmsiuVoGSxvl-1M_oWittcftO955tijzeNc-cgJlo8 ] | ||
googleforms_googlesheet: | ||
|
||
###### Slido ###### | ||
refresh-slido: yes | ||
drive_id: 1XWXHHyj32Uw_UyaUJrqp6S--hHnM0-7l | ||
slido_googlesheet: | ||
|
||
###### YouTube ###### | ||
refresh-youtube: yes | ||
video_ids: [ XN_QPRrJZAw, YkYnni-WuaQ ] | ||
youtube_googlesheet: | ||
|
||
################## DOCKER ####################### | ||
# What docker image should be used for rendering? | ||
# The default is cansav09/metricminer:main | ||
rendering-docker-image: 'cansav09/metricminer:main' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.