Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 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 = "</h5>
  9. Lounge: ";
  10. $html_money_to_end = substr($html_file,strpos($html_file, $texttosearch) + strlen($texttosearch));
  11. $lowest_price = substr($html_money_to_end, 0,strpos($html_money_to_end, " "));
  12. @include_once ("set.php");
  13. $rs = mysql_query("SELECT * FROM items WHERE name='$item'");
  14. if(mysql_num_rows($rs) > 0) {
  15. $row = mysql_fetch_array($rs);
  16. if(time()-$row["lastupdate"] < 3600) die($row["cost"]);
  17. }
  18. mysql_query("DELETE FROM items WHERE name='$item'");
  19. mysql_query("INSERT INTO items (`name`,`cost`,`lastupdate`) VALUES ('$item','$lowest_price','".time()."')");
  20. echo $lowest_price;
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement