Advertisement
Guest User

Untitled

a guest
Sep 17th, 2013
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2. include('class.php');
  3. $hb = new hb;
  4.  
  5. $c = $hb->preg_file('@&nbsp;...&nbsp;<a href=".+?" onclick="SearchLinkClick( this ); return false;">(.+?)</a>@', "http://store.steampowered.com/search/?sort_by=Released&sort_order=DESC");
  6.  
  7. if(isset($c[1])){
  8. $c = intval($c[1]);
  9. }
  10.  
  11. $c = 3;
  12.  
  13. //$latest = $hb->latest_game();
  14.  
  15. // Thumb URL: http://cdn3.steampowered.com/v/gfx/apps/<APP ID>/capsule_sm_120.jpg
  16. // Header URL: http://cdn3.steampowered.com/v/gfx/apps/<APP ID>/header_292x136.jpg
  17.  
  18. for($page = 1; $page <= $c; $page++) { // run through all search result pages
  19. $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);
  20. foreach($m as $a) { // run through all apps on page
  21. /*if($a[1] == $latest['steam_id']) { // At previous most recent game
  22. // Do something
  23. break 2;
  24. } else {*/
  25. $apps[] = $a;
  26. /*}*/
  27. }
  28. }
  29.  
  30. $apps = (is_array($apps)) ? array_reverse($apps) : false;
  31.  
  32. $hb->add_to_db($apps);
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement