Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2. $original_item = $_GET['item'];
  3. $item = str_replace("\"", "", $original_item);
  4. $item = str_replace("\'", "", $item);
  5. $item = str_replace(" ", "%20", $item);
  6. $item = str_replace("\\", "", $item);
  7. $html_file = file_get_contents("http://csgobackpack.net/lounge.php?search=$item&currency=dollar");
  8. $texttosearch = "<div class='media-body'>
  9.                         <h5 class='media-heading'>$original_item</h5>
  10.                         Lounge: ";
  11. $html_money_to_end = substr($html_file,strpos($html_file, $texttosearch) + strlen($texttosearch));
  12. $lowest_price = substr($money_to_end, 0,strpos($money_to_end, " "));
  13. @include_once ("set.php");
  14. $rs = mysql_query("SELECT * FROM items WHERE name='$item'");
  15. if(mysql_num_rows($rs) > 0) {
  16.  $row = mysql_fetch_array($rs);
  17.  if(time()-$row["lastupdate"] < 3600) die($row["cost"]);
  18. }
  19. mysql_query("DELETE FROM items WHERE name='$item'");
  20. mysql_query("INSERT INTO items (`name`,`cost`,`lastupdate`) VALUES ('$item','$lowest_price','".time()."')");
  21. echo $lowest_price;
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement