R/generateWP.R

WPHeader <- readLines("~/JournalWatchPBPath/_WPHeader.Rmd")

newPancreas <- if (length(newPMIDList_pancreas$X1) > 0) {
    readLines("~/JournalWatchPBPath/_newpancreas.Rmd")  
} else {
    "Today there is no new Pancreas Article."
}

newGallbladder <- if (length(newPMIDList_gallbladder$X1) > 0) {
    readLines("~/JournalWatchPBPath/_newgallbladder.Rmd")
} else {
    "Today there is no new Gallbladder Article."
}


newBileDucts <- if (length(newPMIDList_bileducts$X1) > 0) {
    readLines("~/JournalWatchPBPath/_newbileducts.Rmd")
} else {
    "Today there is no new Bile Duct Article."
}

newAmpulla <- if (length(newPMIDList_ampulla$X1) > 0) {
    readLines("~/JournalWatchPBPath/_newampulla.Rmd")
} else {
    "Today there is no new Ampulla Article."
}

if ( (length(newPMIDList_pancreas$X1) + 
      length(newPMIDList_gallbladder$X1) +
      length(newPMIDList_bileducts$X1) + 
      length(newPMIDList_ampulla$X1)
      ) > 0
) {


cat(WPHeader,
    "To see all journal watch articles please visit: http://pbpath.org/journal-watch-upcoming-issue/", "\n",
    "### New Pancreas Articles", "\n",
    newPancreas, "\n",
    "### New GallBladder Articles", "\n",
    newGallbladder, "\n",
    "### New BileDuct Articles", "\n",
    newBileDucts, "\n",
    "### New Ampulla Articles", "\n",
    newAmpulla, "\n","\n",
    "To see all journal watch articles please visit: http://pbpath.org/journal-watch-upcoming-issue/", "\n",
    file = "~/JournalWatchPBPath/candidates/WP.Rmd",
    sep = "\n")


Sys.setenv(RSTUDIO_PANDOC = "/Applications/RStudio.app/Contents/MacOS/pandoc"); rmarkdown::render('/Users/serdarbalciold/JournalWatchPBPath/candidates/WP.Rmd',  encoding = 'UTF-8', knit_root_dir = '~/AutoJournalWatch', quiet = TRUE)



}



Sys.sleep(10)
sbalci/AutoJournalWatch documentation built on Aug. 13, 2020, 4:18 p.m.