How get last 10 tweets of certain user using php?

2019-09-19 16:17发布

I need to receive just few my last tweets for short timeline on my homepage. Tell me the easiest way to do this.
PS I use Codeigniter and it would be nice to get a solution for it ^_^

Thank you so much for the earlier

2条回答
成全新的幸福
2楼-- · 2019-09-19 16:36

Zend_Service_Twitter example from the manual:

$twitter = new Zend_Service_Twitter(array(
    'username' => 'johndoe',
    'accessToken' => $token,
    'count' => 10,
));
$response   = $twitter->status->userTimeline();

You can use it just fine with codeignitor.

查看更多
神经病院院长
3楼-- · 2019-09-19 16:39

I was just looking into this same thing this morning. Found this helpful tidbit from Greg Aker http://www.gregaker.net/2011/feb/12/codeigniter_reactors_caching_drivers/ It loads in the latest X number of tweets as well as uses caching. There is a bunch more query params that can be sent t the Twitter API. You can see them all at http://apiwiki.twitter.com/w/page/22554679/Twitter-API-Documentation

查看更多
登录 后发表回答