How do I show latest tweet on my site using 1.1 Api?


I used the tutorial over at Stack Overflow titled ‘So you want to use the Twitter v1.1 API?’ - it’s here:

The tutorial was good for helping me set up a twitter dev account but doesn’t show me how to display the information it finds. For example it can GET a list of followers, but it just echoes a bunch of user ids on the page. I need help getting the latest tweet, and know wing what to do with the information the Twitter api sends me.

Sorry if this is really basic. Thanks for your time!


oh ~ nobody knows?


:slight_smile: it seems nobody wants te share?! :wink: or they also do not know?!


I am having the same problem and cannot find any answers.


It is nuts. Can’t believe this is so difficult.


me too, Only want the last tweet


Oh you can show your latest tweet with the
parameter added to your widget timeline, but it won’t auto-update. So all they
will see was the latest tweet when the page was loaded.
You could auto-refresh the page but this may get you flagged
by Symantec.


For everyone wanting to solve this using 1.1, head over to He’s got it working using the setup discussed here:

And you can format the appearance of the JSON response (and limit the number of tweets if you only want to show the last tweet) by following the guidelines here:

Thanks so much, Tom E.!


here’s how i got it working:

set up a new app for this client/site and then get the keys
// Your Twitter App Consumer Key
private $consumer_key = ‘XXXXXXXXXX’;

// Your Twitter App Consumer Secret
private $consumer_secret = 'XXXXXXXXXX';

// Your Twitter App Access Token
private $user_token = 'XXXXXXXXXX';

// Your Twitter App Access Token Secret
private $user_secret = 'XXXXXXXXXX';

i used the tweet.js mod here:

drop your tokens into the index.php inside the /twitter/ folder.
** you’ll need to update the modpath to reflect where the feed is being shown **

it’s a little fiddly, but it works.

good luck!


Great libs. I tryed that and it’s working very well!


Thanks man!


How get the tweets for specific date using getUserTimeLIne()

plzzzz help


Plz tell me tell step by step. I am not getting.
Thanks in advance


Something like this will work if you have a PHP Twitter oAuth lib. It will show the latest 3 tweets. See the API documentation to optimize it further:

$tweets = $connection->get('statuses/user_timeline', array('screen_name' => USERNAME, 'count' => '3' )); foreach ($tweets as $tweet) { echo "
".$tweet->text.""; }