# NOT RUN {
if(url.exists("http://www.omegahat.net/RCurl/index.html")) withAutoprint({
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.
cat(headers$value())
headers$reset()
## Debugging callback
d = debugGatherer()
x = getURL("http://www.omegahat.net/RCurl/index.html", debugfunction = d$update, verbose = TRUE)
cat(names(d$value()))
d$value()[["headerIn"]]
## This hangs on Solaris
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) # no names this way
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)
# }
Run the code above in your browser using DataLab