【发布时间】:2015-06-16 22:16:38
【问题描述】:
我正在使用 Twitter API 1.1,并且正在获取用户的推文。
我正在使用此代码
<?php
$url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
$requestMethod = "GET";
$cursor = isset($cursor) ? $cursor : "-1";
$getfield = "?cursor=" . $cursor . "&user_id=" . $user . "&count=10";
$twitter = new TwitterAPIExchange($settings);
$string = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
$tweets = json_decode($string, 1);
echo '<pre>';print_r($string);echo '</pre>';
?>
有没有办法在一个特定的请求之后接收 since_id,以便我可以从最后一个接收到的 id 开始为下一个请求重新排队我的函数?
例如:在单个请求中,我获取 0-1000 条记录,在我的下一个请求中,我希望从第 1001 条记录开始。
在推特上可以吗?
【问题讨论】: