經過數小時和數小時的搜索,我終於找到了gamercards的API腳本。唯一的問題是這個驚人的事情每30分鐘更新一次。如果我打開一個新的瀏覽器並轉到網址,我會得到最新的更新信息。有沒有一種方法來欺騙這個事情,認爲每次刷新都是新的瀏覽器會話?gamercards的API腳本
http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=gamerholics
這裏的腳本。
<?php
$ch = curl_init("http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=gamerholics");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
$data = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXmlElement($data, LIBXML_NOCDATA);
foreach ($xml->PresenceInfo as $mystatus)
{
print '<div id="xboxlivestatus"><a href="' . $xml->ProfileUrl . '">' . $xml->Gamertag . '</a> is ' . $mystatus->StatusText . ' : ' . $mystatus->Info . ' : ' . $mystatus->Info2. '</div>';
}
?>
爲什麼你需要更頻繁地更新遊戲卡,而不是Microsoft API旨在爲您提供的更新頻率?據推測,微軟花費了大量的時間和資金開發API,這對玩家很有用,並且不會殺死他們的服務器。 – 2010-07-19 16:07:02
這不是開發API的微軟,你的反應是判斷性的,不向前移動。顯然我有我的理由。 – 2010-07-19 16:11:01