Watch Steam for price drops

This could probably be done a little better, but the core idea is here: Watch a set of specified games on Steam and, if the price drops, send out a notification email. Set this up on a daily cron job and you’ll be notified when the game you’re looking for drops in price. Might be months, but it’ll likely happen.


$games = array(
    "Batman: Arkham Asylum" => array(
        "id" => 35010,
        "known" => "$49.99 USD"
    )
);
foreach ($games as $name => $values) {
    $doc = new DOMDocument();
    @$doc->loadHTMLFile(
        "http://store.steampowered.com/app/{$values['id']}/"
    );
    $current = $doc->getElementById("game_area_purchase") \
        ->getElementsByTagName("div")->item(1)->nodeValue;
    if ($current != $attributes['known']) {
        mail(
            'youraddress@example.com',
            'Price drop on steam',
            "$name dropped to $current"
        );
    }
}

Maybe better would be to collect the price from each day over a set of games and graph this data over time. It’s not necessary, but I’d be curious to see that extension of this idea.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>