0
以下代碼應該採用來自Twitter的xml提要並回顯結果。來自Twitter的PHP XML提要用法
<?php
$xml = simplexml_load_file('https://api.twitter.com/1/statuses/user_timeline/QuiteCheesedOff.xml?count=6');
$tweets = $xml->xpath("/statuses/status");
foreach($tweets as $tweet) {
$text = $tweet->text;
$date = $tweet->created_at;
echo '<div>' . $text . '</div>' . '<b>' . $date . '</b>';
}
?>
相反,它返回這個。
警告: 使用simplexml_load_file(https://api.twitter.com/1/statuses/user_timeline/QuiteCheesedOff.xml?count=6) [function.simplexml負荷文件]:未能打開流:HTTP請求 失敗! HTTP/1.0 400 /home/divethe1/public_html/robin-knight.com/wp-content/themes/RIKsoft/index.php 錯誤的請求上線142
它可能與速率限制有關:https://dev.twitter.com/docs/rate-limiting –
IT的工作原因不明原因 –
由於未知原因,IT無法再工作 –