Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('class.php');
- $hb = new hb;
- $c = $hb->preg_file('@ ... <a href=".+?" onclick="SearchLinkClick( this ); return false;">(.+?)</a>@', "http://store.steampowered.com/search/?sort_by=Released&sort_order=DESC");
- if(isset($c[1])){
- $c = intval($c[1]);
- }
- $c = 3;
- //$latest = $hb->latest_game();
- // Thumb URL: http://cdn3.steampowered.com/v/gfx/apps/<APP ID>/capsule_sm_120.jpg
- // Header URL: http://cdn3.steampowered.com/v/gfx/apps/<APP ID>/header_292x136.jpg
- for($page = 1; $page <= $c; $page++) { // run through all search result pages
- $m = $hb->preg_file("@<a href=\"http://store\.steampowered\.com/app/([0-9]+)/.+?\" class=\"search_result_row.+?\">.+?<img src=\"http://cdn2.store.steampowered.com/public/images/ico/ico_type_(app|dlc).gif\">.+?<h4>(.+?)</h4>.+?</a>@ms", "http://store.steampowered.com/search/?sort_by=Released&sort_order=DESC&page=".$page);
- foreach($m as $a) { // run through all apps on page
- /*if($a[1] == $latest['steam_id']) { // At previous most recent game
- // Do something
- break 2;
- } else {*/
- $apps[] = $a;
- /*}*/
- }
- }
- $apps = (is_array($apps)) ? array_reverse($apps) : false;
- $hb->add_to_db($apps);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement