Created
December 15, 2016 22:09
-
-
Save jemus42/a9e1fce7229fa01c51cafd0df04475c2 to your computer and use it in GitHub Desktop.
Simple amazon scraper with slack notification because @danjel
This file contains hidden or 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
library(rvest) # Parse HTML | |
library(httr) # Send POST request, I think rvest depends on that anyway | |
url <- "https://www.amazon.de/dp/B01M0LHEZI" | |
slack_url <- "somewebhookurlimtoolazytoget" | |
avail <- read_html(url) %>% | |
html_node("#availability :first-child") %>% | |
html_text(trim = T) | |
if (grepl(avail, pattern = "Lager")) { | |
POST(url = slack_url, | |
body = list(text = "Kopfhörer sind verfügbar!"), | |
encode = "json") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment