我试图使用这一小段代码来获取用户的汽车库存:
$url = $steamprofile['profileurl']."inventory/json/730/2";
var_dump($url);
$json = json_decode(file_get_contents($url));
foreach($json->rgDescriptions as $value => $v) {
if ($v->tradable === 1) {
$name = $v->market_hash_name;
$icon_url = $v->icon_url;
?>
<div class="img__wrap">
<img class="img__img" src="http://cdn.steamcommunity.com/economy/image/<?=$icon_url?>" />
<div class="img__description_layer">
<p class="img__description"><?= $name ?></p>
</div>
</div>
<?php
} else {
}
}
但如果我刷新页面大约2-4次,我会收到HTTP 429 Too Many Requests错误。 有什么方法可以让这种事情不发生,或者这只是我无法解决的问题?