I can include the twiiter API . But I have to show the LAST TWEET TIME of that account. Is there any way to do it?
Thanks
I can include the twiiter API . But I have to show the LAST TWEET TIME of that account. Is there any way to do it?
Thanks
First, you would call GET statuses/user_timeline to retrieve the tweets of the user in question. Grab the first tweet off the timeline, which will be the most recent one, and read the "created_at" property.
session_start();
require_once("twitteroauth/twitteroauth/twitteroauth.php"); //Path to twitteroauth library
$twitteruser = "twitterusername";
$notweets = 1;
$consumerkey = "12345";
$consumersecret = "123456789";
$accesstoken = "123456789";
$accesstokensecret = "12345";
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets);
echo $tweets[0]->created_at;
Twitter library can download from here
I got from http://www.webdevdoor.com/php/authenticating-twitter-feed-timeline-oauth