GetData <- function(url, api_key, format) {
res <- getURL(url, userpwd=api_key)
if(tolower(format) == "json") {
res <- fromJSON(res)
} else if(tolower(format) == "xml") {
res <- XMLToList(res)
}
return(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.