Created
January 7, 2019 15:23
-
-
Save charliejhadley/7394ba8a29a48f5de18f95e94c2684bf to your computer and use it in GitHub Desktop.
Show today's Google Doodle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Google Doodle" | |
output: html_document | |
editor_options: | |
chunk_output_type: console | |
--- | |
```{r get-google-foo-url} | |
library("tidyverse") | |
library("rvest") | |
library("glue") | |
google_doodles_page <- read_html("https://www.google.com/doodles") | |
doodle_url <- google_doodles_page %>% | |
html_node(".latest-doodle") %>% | |
html_node("img") %>% | |
html_attr("src") | |
glue("<img src={doodle_url}></img>") %>% | |
htmltools::HTML() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment