Created
June 2, 2014 16:23
-
-
Save taksan/96da2e536406cfc969ad to your computer and use it in GitHub Desktop.
Epic Bundle Scrapping
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
#!/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