August 2018
Beginner to intermediate
214 pages
6h 39m
English
This is all we'll need to scrape the HTML and get the status. Inside scraper-alert-j5.js, we're going to add cheerio's require() call to the top of the file with the other requires:
const cheerio = require('cheerio')
Then, we're going to modify the callback that fires when request is done fetching the HTML. We're going to add the cheerio call to load the text and look for the first p child of the div with ID domain-main-content, and pull out its text. Then, we'll see if that text contains It's just you. and write to the LCD:
function isJohnnyFiveDown() { request('https://downforeveryoneorjustme.com/johnny-five.io', (err, resp, body) => { let $ = cheerio.load(body) let statusText = $('#domain-main-content ...Read now
Unlock full access