php - fetching more user details in twitter


I'm trying to fetch user's details from twitter using php, I have this working code:

  /** Set access tokens here - see: **/
  $settings = array(
'oauth_access_token' => "",
'oauth_access_token_secret' => "",
'consumer_key' => "",
'consumer_secret' => ""
  $url = "";
  $requestMethod = "GET";
  if (isset($_GET['user'])) {$user = $_GET['user'];} else {$user = "";}
  if (isset($_GET['count'])) {$count = $_GET['count'];} else {$count = 1;}
  $getfield = "?screen_name=$user&count=$count";
  $twitter = new TwitterAPIExchange($settings);
  $string = json_decode($twitter->setGetfield($getfield)
  ->buildOauth($url, $requestMethod)
  ->performRequest(),$assoc = TRUE);
  if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>".$string[errors][0]["message"]."</em></p>";exit();}
  foreach($string as $items)
    echo "Time and Date of Tweet: ".$items['created_at']."<br />";
    echo "Tweet: ". $items['text']."<br />";
    echo "Tweeted by: ". $items['user']['name']."<br />";
    echo "Screen name: ". $items['user']['screen_name']."<br />";
    echo "Followers: ". $items['user']['followers_count']."<br />";
    echo "Following: ". $items['user']['friends_count']."<br />";

But I want to fetch more like location, bio, birthday, and so on. how to do this?

People are also looking for solutions to the problem: quickbooks - Php QB Desktop: getting error Error message received from application via getLastError():


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.