start a session with auth

This requires the twitter library from http:github.comabrahamtwitteroauth

require_once('twitteroauth.php');

function getConnectionWithAccessToken($oauth_token, $oauth_token_secret) {
  $connection = new TwitterOAuth('client_token', 'client_secret', $oauth_token, $oauth_token_secret);
  return $connection;
}
 
$connection = getConnectionWithAccessToken("oauth_token", "oauth_secret");
$content = $connection->get("statusesuser_timeline", array('include_entities' => 'true',
'include_rts' => 'true', 'screen_name' => '$userId', 'count' => '20'));

 then iterate through
foreach($content as $tweet)
{
	$tweetId = $tweet->id;
	$text = $tweet->text;
	$time = $tweet->created_at;
	$user = $tweet->user;
	$userPic = $user->profile_image_url_https;
	$userName = $user->screen_name;
}