Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Permalink
Browse files

Change broken if statement.

  • Loading branch information...
greebie committed Oct 15, 2019
1 parent c7f05aa commit e13e94e7b60e83d79043bbaf23d34e19c1970174
Showing with 5 additions and 7 deletions.
  1. +2 −0 .Rbuildignore
  2. +3 −7 R/archivr.R
@@ -1,2 +1,4 @@
^appveyor\.yml$
^\.travis\.yml$
^.*\.Rproj$
^\.Rproj\.user$
@@ -28,8 +28,6 @@
#' @docType package
#' @name archivr



library(readtext)
library(jsonlite)
library(xml2)
@@ -115,7 +113,7 @@ archiv <- function (url_list, method="wayback") {
fold <- get_folder_id()
if (is.null(fold) || fold == "") {
print("Setting folder based on api key.")
set_folder_id(get_default_folder()[1,]$id)
set_folder_id(get_default_folder())
fold <- toString(get_folder_id())
if (is.null(fold) || fold == "") {
stop("Unable to set perma.cc folder. Make sure you API key is set using 'set_api_key(API_KEY)'")
@@ -178,13 +176,11 @@ archiv_perma <- function (arc_url) {
} else if ((!(is.null(reply$error)))) {
stop("Received an error reply, likely because your limit has been exceeded.")
} else {
if (!(is.null(reply$url == "Not a valid URL."))) {
print ("pass")
if (!is.null(reply$url) && !(reply$url == "Not a valid URL.")) {
result <- c(reply$url, reply$guid, reply$archive_timestamp,
reply$captures[1,]$playback_url, reply$captures[2,]$playback_url,
paste0("https://perma.cc/", reply$guid))
} else {
print("2nd pass")
}
}
return(result)
@@ -232,7 +228,7 @@ view_archiv <- function (lst, method="wayback") {
wb <- from_wayback(x)
pc <- from_perma_cc(x)
result <- list(x, "000", FALSE, "url not found", "unknown", "url not found", "unknown")
if (as.logical((unname(unlist(wb)[3]))) && as.logical(unname(unlist(pc)[3]))) {
if (!is.null(unlist(wb)[3]) && !is.null(unname(unlist(pc)[3]))) {
result <- c(wb$url, wb$archived_snapshots$closest$status,
wb$archived_snapshots$closest$available,
wb$archived_snapshots$closest$url,

0 comments on commit e13e94e

Please sign in to comment.
You can’t perform that action at this time.