Skip to content

Instantly share code, notes, and snippets.

@taksan
Created June 2, 2014 16:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taksan/96da2e536406cfc969ad to your computer and use it in GitHub Desktop.
Save taksan/96da2e536406cfc969ad to your computer and use it in GitHub Desktop.
Epic Bundle Scrapping
#!/bin/bash
function getpage()
{
nodejs <<HEREDOC
// npm install request cheerio
var request = require("request");
var cheerio = require("cheerio");
request({ uri: "http://www.epicbundle.com/game" }, function(error, response, body) {
var $ = cheerio.load(body);
\$(".gameList li a[href*='/game/']").each(function() {
console.log(\$(this).text().trim())
})
});
HEREDOC
}
WATCH_LIST="Simul\|Truck"
G=$(getpage | grep --color=none $WATCH_LIST)
if [[ ! -z $G ]]; then
notify-send "Epic Bundle, available games:" "$G"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment