我正在尝试在网页上显示最新的推文,但我不确定该怎么做,因为我对 twitter api 非常陌生,但这是我迄今为止所拥有的。
function my_streaming_callback($data, $length, $metrics) {
echo $data;
}
require '../tmhOAuth.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => 'key',
'consumer_secret' => 'secret',
'user_token' => 'token',
'user_secret' => 'secret',
));
$method = 'http://stream.twitter.com/1/statuses//show/:id.json';
//not sure where I am supposed to get the :id from?
$params = array(
//not sure what to put here, I would like to display the last 5 tweets
);
$tmhOAuth->streaming_request('POST', $method, $params, 'my_streaming_callback');
$tmhOAuth->pr($tmhOAuth);
我正在使用此https://github.com/themattharris/tmhOAuth进行身份验证,然后与 twitter api 进行交互,但我发现它非常令人困惑,因为所有这些对我来说都是非常新的。
所以基本上我只想尝试获取最新的推文,非常感谢任何帮助,因为我需要尽快完成这项工作,谢谢!:)