Skip to content

Commit

Permalink
linkAbstract.R: PMC: improve section formatting by at least forcing p…
Browse files Browse the repository at this point in the history
…aragraph breaks; but still bad because rentrez deletes section headers, filed bug: ropensci/rentrez#170
  • Loading branch information
gwern committed Apr 11, 2021
1 parent 801deea commit b570dc0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build/linkAbstract.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# LinkAbstracter
# Author: gwern
# Date: 2019-08-29
# When: Time-stamp: "2021-01-20 11:18:51 gwern"
# When: Time-stamp: "2021-04-11 12:29:25 gwern"
# License: CC-0
#
# Read a PLOS or PMCID URL, and return the parsed fulltext as newline-delimited Title/Author/Date/DOI/Abstract.
Expand Down Expand Up @@ -99,7 +99,6 @@ if (grepl("plos",args)) {

# DOIs are optional since so many fulltext PMC papers are still missing them
if (any(c(is.list(title), is.list(author), is.list(date), is.list(abstract)))) {

# fallback to the other fulltext/rentrez path:

pmid <- entrez_search(db = "pubmed", term = pmcidSearch)$ids
Expand Down Expand Up @@ -127,6 +126,6 @@ if (grepl("plos",args)) {
cat(c(author, "\n"))
cat(c(as.character(date), "\n"))
if (is.list(doi)) { cat("\n"); } else { cat(c(doi, "\n")) }
cat(c(abstract, "\n"))
cat(paste0(abstract, sep="\n\n"))

}

0 comments on commit b570dc0

Please sign in to comment.