get tweets of friends using twitter api

<?php
ini_set(‘display_errors’, 1);
require_once(‘TwitterAPIExchange.php’);

/** Set access tokens here – see: https://dev.twitter.com/apps/ **/
$settings = array(
‘oauth_access_token’ => “”,
‘oauth_access_token_secret’ => “”,
‘consumer_key’ => “”,
‘consumer_secret’ => “”
);

/** URL for REST request, see: https://dev.twitter.com/docs/api/1.1/ **/

$url = “https://api.twitter.com/1.1/statuses/user_timeline.json&#8221;;

$requestMethod = “GET”;

$getfield = ‘?count=30&screen_name=isupportbiebs’;

$twitter = new TwitterAPIExchange($settings);
$string=json_decode($twitter->setGetfield($getfield)->buildOauth($url,$requestMethod)->performRequest());
foreach($string as $s){
echo “twwets:-“.$s->text.”<br>”;
}
?>

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s