Skip to content

Instantly share code, notes, and snippets.

@charliejhadley
Created January 7, 2019 15:23
Show Gist options
  • Save charliejhadley/7394ba8a29a48f5de18f95e94c2684bf to your computer and use it in GitHub Desktop.
Save charliejhadley/7394ba8a29a48f5de18f95e94c2684bf to your computer and use it in GitHub Desktop.
Show today's Google Doodle
---
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