if(url.exists("http://www.omegahat.net/RCurl/index.html")) {
txt = getURL("http://www.omegahat.net/RCurl/index.html", write = basicTextGatherer())
h = basicTextGatherer()
txt = getURL("http://www.omegahat.net/RCurl/index.html", write = h$update)
# Cumulate across pages.
txt = getURL("http://www.omegahat.net/index.html", write = h$update)
headers = basicTextGatherer()
txt = getURL("http://www.omegahat.net/RCurl/index.html",
header = TRUE, headerfunction = headers$update)
# Now read the headers.
headers$value()
headers$reset()
# Debugging callback
d = debugGatherer()
x = getURL("http://www.omegahat.net/RCurl/index.html", debugfunction = d$update, verbose = TRUE)
names(d$value())
d$value()[["headerIn"]]
uris = c("http://www.omegahat.net/RCurl/index.html",
"http://www.omegahat.net/RCurl/philosophy.html")
g = multiTextGatherer(uris)
txt = getURIAsynchronous(uris, write = g)
names(txt)
nchar(txt)
# Now don't use names for the gatherer elements.
g = multiTextGatherer(length(uris))
txt = getURIAsynchronous(uris, write = g)
names(txt)
nchar(txt)
}
## Not run:
# Sys.setlocale(,"en_US.latin1")
# Sys.setlocale(,"en_US.UTF-8")
# uris = c("http://www.omegahat.net/RCurl/index.html",
# "http://www.omegahat.net/RCurl/philosophy.html")
# g = multiTextGatherer(uris)
# txt = getURIAsynchronous(uris, write = g)
# ## End(Not run)
Run the code above in your browser using DataLab