Closed Xeroner closed 8 years ago
If you delete the 0 prices, it uses the prices directly from the market :)
And then for time to time steam blocking connection :)
Worked on a method getting prices via www.bitskins.com api, both csgojackpot and csgowild uses it
And it managed to work it out last night, i can tell what to do tomorrow :)
Fully free and unlimited?
Its free and you can do 8 requests a second :)
8 is to small i think for bigger jackpot
You can contact them to gain more, but i think that cost extra :) ill release a detailed guide or just the files if people wants it, going to bed soon :)
@Stuffa1991 can you share the implemention of the API with us?
Okay i'll make this as detailed as i can :)
I tried making the code i made so versatile so you only have to change the URL in check-items.php
Step by Step
Thats it for BitSkins.com, you can close it now :)
Now to the important parts
1. Create a file called GoogleAuthenticator.php Paste this in http://codeshare.io/ROdWA
2. Create a file called price.php Paste this in http://codeshare.io/fRELz
$marketObj = json_decode(file_get_contents("http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=$hash"), true);
to
$marketObj = json_decode(file_get_contents("http://yourwebsite.com/php/price.php$hash"), true);
And thats about it, your bot should now retrieve bitskins prices, which are used by csgowild and csgojackpot :)
I followed your guide 100% @Stuffa1991 - how can i check if my prices update? And when will they update?
Best regards
@rfalkner you need to replace steamcommunity lines to this script. This will not update your database man. It's should check price when user joining the pot.
@rfalkner, to keep the prices you have to add something in the check-items.php
Like so on line 136~
if (isset($medianPrice)) {
$price = doubleval(substr($medianPrice, 1)) * 100;
$sql = "INSERT INTO items (marketName, avgPrice30Days)
VALUES (:marketName, :avgPrice30Days)
ON DUPLICATE KEY UPDATE avgPrice30Days = :newPrice";
$stmt = $db->prepare($sql);
$stmt->bindValue(':marketName', $marketName);
$stmt->bindValue(':avgPrice30Days', $price);
$stmt->bindValue(':newPrice', $price);
$stmt->execute();
} else {
$price = doubleval(substr($lowestPrice, 1)) * 100;
$sql = "INSERT INTO items (marketName, avgPrice30Days)
VALUES (:marketName, :avgPrice30Days)
ON DUPLICATE KEY UPDATE avgPrice30Days = :newPrice";
$stmt = $db->prepare($sql);
$stmt->bindValue(':marketName', $marketName);
$stmt->bindValue(':avgPrice30Days', $price);
$stmt->bindValue(':newPrice', $price);
$stmt->execute();
}
And truncate the price tables.
The reason for this is that the check-items works without a timestamp for example that means everytime the bot checks the price, it takes the price in the price table without asking questions, and if it doesnt exist it doesnt add it to the price table but simply return the price.
With this added code it will add the price into the price table instead of only returning the price if the item is non excitence :)
@Stuffa1991 script need to check first ,, if item exist do not insert but update ,,
Well the update part isnt actually supposed to be there, cause it will never occure, cause the script itself finds if the values exist and if it does it returns the price, therefore an update will never occure and is just there for no reason :D
But if table is empty? :dancer:
It will update the price only if the price is set to 0, else it will insert
As you can see ON DUPLICATE KEY UPDATE, means that if the thing it tries to insert is already there just update it instead, so its a sort of a fail safe for if the items that exist has a value of 0 :)
@Stuffa1991 you're right :)
@Stuffa1991 The GoogleAuthenticator.php is not longer available, can you post it again? Or create a new wiki page
+1 Would be great!
Hello, can anybody update item database ? Becouse it's realy realy old and have a lot of 0 prices. @ztizzlegaming