How get last 10 tweets of certain user using php?

2019-09-19 16:27发布

问题:

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

回答1:

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.



回答2:

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