Created
March 24, 2025 18:05
-
-
Save timriffe/3af54a861cface3fd419689a259726b4 to your computer and use it in GitHub Desktop.
a second script to get the same statistics from opencite.org (second-order citations)
This file contains hidden or 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
# See also https://gist.github.com/timriffe/f820143e939f9262b3083122e1ce49ae | |
# for semantic scholar. Sorry output isn't harmonized | |
get_citing_papers_opencite <- function(doi){ | |
openciteurl <- paste0( "https://opencitations.net/index/coci/api/v1/citations/",doi ) | |
result <- rjson::fromJSON(file = openciteurl) | |
result |> lapply(as_tibble) |> bind_rows() | |
} | |
get_second_order_citations_opencite <- function(doi){ | |
citing <- get_citing_papers_opencite(doi) | |
dois <- citing$citing | |
cites <- sapply(dois, function(doi){ | |
get_citing_papers_opencite(doi) |> nrow()}) | |
citing$second_order_cites <- cites | |
citing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment