Skip to content

Instantly share code, notes, and snippets.

@DuckThom
Created June 20, 2017 09:40
Show Gist options
  • Select an option

  • Save DuckThom/34902b83f4ef3ef79cc56c297a475aee to your computer and use it in GitHub Desktop.

Select an option

Save DuckThom/34902b83f4ef3ef79cc56c297a475aee to your computer and use it in GitHub Desktop.
const request = require('request');
const cheerio = require('cheerio');
let url = process.argv[2];
console.log("Loading current Apple order status...\n\n");
request(url, function (error, response, body) {
if (error) {
throw error;
}
var $ = cheerio.load(body);
$('.sb-heading > h3 > span:first-child').filter(function() {
var data = $(this);
console.log("Status: " + data.first().text() + " @ " + (new Date));
});
});
{
"dependencies": {
"cheerio": "^1.0.0-rc.1",
"request": "^2.81.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment