This uses the MementoWeb Time Travel Service to directly retrieve retrieve URL content. You get (slightly augmented by MementoWeb) orignal URL content from at or near the timestamp you specify.

read_memento(url, timestamp = format(Sys.Date(), "%Y"), as = c("text",
  "raw", "parsed"))

Arguments

url

URL to retrieve information for

timestamp

timestamp to use when checking for availability.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.

as

How you want the content returned. One of "text", "raw" or "parsed" (it uses httr::content() to do the heavy lifting).

Value

The specified content type

Details

This can be helpful if you find the resource you need is gone today but still exists in the memory of the internet.

References

Time Travel API

Examples

# NOT RUN {
library(htmltools)
library(rvest)

yahoo_old <- read_memento("http://yahoo.com", "2010")

html_print(HTML(yahoo_old)) # opens browser

pg <- xml2::read_html(yahoo_old)
html_nodes(pg, "a.x3-large") %>%
  html_text()
## Tiger loses one more sponsorship"
# }