Using tweets using PHP
I am trying to grab tweets from Twitter. I have a list of users that I would like to receive their tweets and store them in my database. I would like to know if I will be using the Twitter API or if there is some simple code 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 right for me?
Thanks everyone.
+3
source to share
1 answer
It couldn't be easier with Twitter. Just file_get_contents()
this URL: http://twitter.com/statuses/user_timeline.json?screen_name=USERNAME&count=10 and you will receive JSON with the latest USERNAME tweets.
$tweets = json_decode(file_get_contents('http://twitter.com/statuses/user_timeline.json?screen_name=USERNAME&count=10'));
var_dump($tweets);
+3
source to share