I am trying to grab tweets from Twitter. What I have is a list of users which I would like to grab their tweets from and store them in my database. I would like to know if I am going to use Twitter API or is there any simple code for me to achieve this.
According to https://dev.twitter.com/docs/twitter-libraries#php there are five libraries in PHP. I would like to know which one is good for me to use?
Thanks everyone.
With Twitter it couldn't be simpler. Just file_get_contents() this URL: http://twitter.com/statuses/user_timeline.json?screen_name=USERNAME&count=10 and you'll get a JSON with USERNAME's 10 latest tweets.
$tweets = json_decode(file_get_contents('http://twitter.com/statuses/user_timeline.json?screen_name=USERNAME&count=10'));
var_dump($tweets);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With