如何用PHP检索20个或更多的twitter状态


How to retrieve 20 or more twitter status with PHP?

这是我第一次使用twitter进行移动开发。我正在使用Adobe Flash AS3和PHP脚本将我自己的twitter状态检索到我自己制作的iphone应用程序中。但是,我无法检索超过20个状态。

PHP:

<?php
header('Content-Type: text/html; charset=utf-8');
$name = $_GET['url'];
$url = 'http://twitter.com/statuses/user_timeline.xml?screen_name=';
$url .= $name;
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 0);
ob_start();
curl_exec ($ch);
curl_close ($ch);
$string = ob_get_contents();
$content = ob_end_clean();
echo $string;
?>

Flash中的CS5.5:

private static const USERNAME:String = "twitterusername";        
private static const URL:String = "http://myserverhost.com/proxy.php?url=";        
private static const REQUEST:String = URL + USERNAME;
urlLoader = new URLLoader();
urlLoader.load(new URLRequest(REQUEST));
urlLoader.addEventListener(Event.COMPLETE, displayInfo);

我在推特上阅读了文档(http://dev.twitter.com/docs/working-with-timelines)然而,你给了我,我仍然对"如何一次询问20多个状态"感到困惑。是否有任何在线教程/示例代码可供参考?

如果您在手册中查找正在使用的方法,则会有一个您可以指定的计数值,最大值为200。

所以像这个

http://twitter.com/statuses/user_timeline.xml?count=[count]&screen_name=[user]

你的意思是:


//use count parameter
$count = 30;
$url = "https://twitter.com/statuses/user_timeline/screen_name.xml?count=".$count;