【发布时间】:2011-10-11 12:34:46
【问题描述】:
我正在尝试访问 twitter 流 api,但是我想限制收到的回复数量,我尝试使用 count 参数:
https://user:pass@stream.twitter.com/1/statuses/sample.json?count=100
但我得到了错误:
Parameter count not allowed in role statusSpritzer
谁能解释为什么不允许这样做?
我尝试使用的代码是这样的:
$url = "https://user:pass@stream.twitter.com/1/statuses/sample.json";
$fp = fopen($url,"r");
while($data = fgets($fp)){
$decode = json_decode($data);
for($i = 0; $i < count($decode); $i++){
echo $decode->$i;
}
}
但由于返回的推文数量太长,处理时间太长,所以我试图限制数量..
【问题讨论】: