Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $original_item = $_GET['item'];
- $item = str_replace("\"", "", $original_item);
- $item = str_replace("\'", "", $item);
- $item = str_replace(" ", "%20", $item);
- $item = str_replace("\\", "", $item);
- $html_file = file_get_contents("http://csgobackpack.net/lounge.php?search=$item¤cy=dollar");
- $texttosearch = "<div class='media-body'>
- <h5 class='media-heading'>$original_item</h5>
- Lounge: ";
- $html_money_to_end = substr($html_file,strpos($html_file, $texttosearch) + strlen($texttosearch));
- $lowest_price = substr($money_to_end, 0,strpos($money_to_end, " "));
- @include_once ("set.php");
- $rs = mysql_query("SELECT * FROM items WHERE name='$item'");
- if(mysql_num_rows($rs) > 0) {
- $row = mysql_fetch_array($rs);
- if(time()-$row["lastupdate"] < 3600) die($row["cost"]);
- }
- mysql_query("DELETE FROM items WHERE name='$item'");
- mysql_query("INSERT INTO items (`name`,`cost`,`lastupdate`) VALUES ('$item','$lowest_price','".time()."')");
- echo $lowest_price;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement