#' Convert google news links to real url
#'
#' @name qnews_get_rurls
#' @param url A characcter vector of URLs
#' @return A character vector
#'
#' @export
#' @rdname qnews_get_rurls
#'
qnews_get_rurls <- function(x){
lapply(x, function(q){
site <- tryCatch(
xml2::read_html(httr::GET(q, httr::timeout(60))),
error = function(e) 'no')
if(length(site) == 1){NA}else{
linkto <- site |> xml2::xml_find_all("c-wiz") |> xml2::xml_text()
gsub('Opening ', '', linkto)
#linkto |> unname()
}
}) |> unlist()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.