This performs a simple test to see if a given url is archived and currenlty accessible in the Wayback Machine.

archive_available(url, timestamp)

Arguments

url

URL to retrieve information for

timestamp

(optional) timestamp to use when checking for availability. If not specified, the most recenty available capture in Wayback is returned. If you don't pass in a valid R "time-y" object, you will need to ensure the character string you provide is in a valid subset of YYYYMMDDhhmmss.

Value

data frame

Details

If a resource is found, the returned data frame will have available set to TRUE and the closest_url, timestamp and status fields populated. If the resource is not found, the url field will be populated along with a status field that has a value of "404".

References

https://archive.org/help/wayback_api.php

Examples

# NOT RUN {
rproj_avail <- archive_available("https://www.r-project.org/")

str(rproj_avail)
## Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	1 obs. of  5 variables:
##  $ url       : chr "https://www.r-project.org/"
##  $ available : logi TRUE
##  $ closet_url: chr "http://web.archive.org/web/20170830061210/http://www.r-project.org/"
##  $ timestamp : POSIXct, format: "2017-08-30"
##  $ status    : chr "200"
# }