こんにちは私は面白いためにプライベートWebページで作業しています。私は蒸気APIからjsonを取得するための呼び出しを行い、ユーザーのアバターを取得できるようにします。ここに私のコードです。Steam APIコールでストリームを開くことができませんでした
function getSteamImage() {
$key = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
$json = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$key&steamids=76561197960435530');
$json_array = json_decode($json,true);
$image = $json_array["response"]["players"]["avatar"];
return $image;
}
<li><img src="<?= getSteamImage() ?>"></li>
しかし今、このエラーを取得イム:
file_get_contents(http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=XXXXXXXXXXXXXXXX&steamids=76561197960435530): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
ところで、私はここで使用するスチームキーは、私は、スクリプトで使用しているものではありません!